LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices



Reply
 
Search this Thread
Old 07-17-2013, 09:55 PM   #1
anandr4u
LQ Newbie
 
Registered: Jul 2013
Location: India
Distribution: RHEL
Posts: 6

Rep: Reputation: Disabled
Issue with Reverse Lookup on RHEL 5 when using BIND


Hi Everyone,

I am trying to configure DNS (Using BIND) on RHEL 5 test machine. I configured all the necessary files for the same. When i try to resolve the hostname its working with out any issues. But when i try the reverse lookup using the IP address its giving an error.

Please help me with this issue. Thanks in advance.

[root@orarmanlab named]# nslookup 10.100.1.10
Server: 10.100.1.10
Address: 10.100.1.10#53

** server can't find 10.1.100.10.in-addr.arpa: SERVFAIL

[root@orarmanlab named]#

[root@orarmanlab named]# dig -x 10.100.1.10

; <<>> DiG 9.3.4-P1 <<>> -x 10.100.1.10
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 35536
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;10.1.100.10.in-addr.arpa. IN PTR

;; Query time: 26 msec
;; SERVER: 10.100.1.10#53(10.100.1.10)
;; WHEN: Wed Jul 17 20:59:19 2013
;; MSG SIZE rcvd: 42



[root@orarmanlab named]# nslookup orarmanlab.anand.com
Server: 10.100.1.10
Address: 10.100.1.10#53

Name: orarmanlab.anand.com
Address: 10.100.1.10


[root@orarmanlab named]# nslookup orarmanlab
Server: 10.100.1.10
Address: 10.100.1.10#53

Name: orarmanlab.anand.com
Address: 10.100.1.10


[root@orarmanlab named]# dig orarmanlab.anand.com

; <<>> DiG 9.3.4-P1 <<>> orarmanlab.anand.com
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 13152
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 0

;; QUESTION SECTION:
;orarmanlab.anand.com. IN A

;; ANSWER SECTION:
orarmanlab.anand.com. 86400 IN A 10.100.1.10

;; AUTHORITY SECTION:
anand.com. 86400 IN NS orarmanlab.anand.com.

;; Query time: 1 msec
;; SERVER: 10.100.1.10#53(10.100.1.10)
;; WHEN: Wed Jul 17 20:59:10 2013
;; MSG SIZE rcvd: 68

DNS FILES
***********************************************************************

[root@orarmanlab named]# more reverse.zone
$ORIGIN 10.1.100.in-addr.arpa.
$TTL 86400
@ IN SOA orarmanlab.anand.com. root.orarmanlab.anand.com. (
1997022700 ; Serial
28800 ; Refresh
14400 ; Retry
3600000 ; Expire
86400 ) ; Minimum
IN NS orarmanlab.anand.com.
10 IN PTR orarmanlab.anand.com.
[root@orarmanlab named]#


[root@orarmanlab named]# more forward.zone
$TTL 86400
@ IN SOA orarmanlab.anand.com. root.orarmanlab.anand.com. (

42 ; serial (d. adams)
3H ; refresh
15M ; retry
1W ; expiry
1D ) ; minimum
IN NS orarmanlab.anand.com.
orarmanlab IN A 10.100.1.10

[root@orarmanlab named]#

[root@orarmanlab etc]# more named.conf
//
// named.caching-nameserver.conf
//
// Provided by Red Hat caching-nameserver package to configure the
// ISC BIND named(8) DNS server as a caching only nameserver
// (as a localhost DNS resolver only).
//
// See /usr/share/doc/bind*/sample/ for example named configuration files.
//
// DO NOT EDIT THIS FILE - use system-config-bind or an editor
// to create named.conf - edits to this file will be lost on
// caching-nameserver package upgrade.
//
options {
listen-on port 53 { 10.100.1.10; };
# listen-on-v6 port 53 { ::1; };
directory "/var/named";
dump-file "/var/named/data/cache_dump.db";
statistics-file "/var/named/data/named_stats.txt";
memstatistics-file "/var/named/data/named_mem_stats.txt";

// Those options should be used carefully because they disable port
// randomization
// query-source port 53;
// query-source-v6 port 53;

allow-query { any; };
};
logging {
channel default_debug {
file "data/named.run";
severity dynamic;
};
};
view localhost_resolver {
match-clients { any; };
match-destinations { 10.100.1.10; };
recursion yes;
include "/etc/named.rfc1912.zones";
};
[root@orarmanlab etc]#



[root@orarmanlab etc]# more named.rfc1912.zones
// named.rfc1912.zones:
//
// Provided by Red Hat caching-nameserver package
//
// ISC BIND named zone configuration for zones recommended by
// RFC 1912 section 4.1 : localhost TLDs and address zones
//
// See /usr/share/doc/bind*/sample/ for example named configuration files.
//
zone "." IN {
type hint;
file "named.ca";
};

zone "anand.com" IN {
type master;
file "forward.zone";
allow-update { none; };
};

zone "localhost" IN {
type master;
file "localhost.zone";
allow-update { none; };
};

zone "10.1.100.in-addr.arpa" IN {
type master;
file "reverse.zone";
allow-update { none; };
};

zone "0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa" IN {
type master;
file "named.ip6.local";
allow-update { none; };
};

zone "255.in-addr.arpa" IN {
type master;
file "named.broadcast";
allow-update { none; };
};

zone "0.in-addr.arpa" IN {
type master;
file "named.zero";
allow-update { none; };
};
[root@orarmanlab etc]#

[root@orarmanlab etc]# more /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
10.100.1.10 orarmanlab.anand.com orarmanlab
127.0.0.1 localhost.localdomain localhost
::1 localhost6.localdomain6 localhost6
[root@orarmanlab etc]#



[root@orarmanlab etc]# more /etc/resolv.conf
domain anand.com
nameserver 10.100.1.10
[root@orarmanlab etc]#

[root@orarmanlab etc]# more /etc/sysconfig/network
NETWORKING=yes
NETWORKING_IPV6=no
HOSTNAME=orarmanlab.anand.com
[root@orarmanlab etc]#

Last edited by anandr4u; 07-17-2013 at 10:16 PM.
 
Old 07-18-2013, 03:11 AM   #2
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,975

Rep: Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343
You don't need the localhost_resolver view. Remove the view definition:
Quote:
view localhost_resolver {
match-clients { any; };
match-destinations { 10.100.1.10; };
recursion yes;
include "/etc/named.rfc1912.zones";
};
and leave just the line:
Code:
include "/etc/named.rfc1912.zones";
 
Old 07-18-2013, 08:47 PM   #3
anandr4u
LQ Newbie
 
Registered: Jul 2013
Location: India
Distribution: RHEL
Posts: 6

Original Poster
Rep: Reputation: Disabled
Hi,

I edited the named.conf and removed the localhost_resolver view. After that i rebooted the server and started the named service. But again the same issue is coming up.

I renamed the reverse.zone and tried to start the named service but its throwing file not found error.

The reverse.zone file is getting read but it seems there is some issue with the scripting inside reverse.zone.


[root@orarmanlab etc]# more named.conf
//
// named.caching-nameserver.conf
//
// Provided by Red Hat caching-nameserver package to configure the
// ISC BIND named(8) DNS server as a caching only nameserver
// (as a localhost DNS resolver only).
//
// See /usr/share/doc/bind*/sample/ for example named configuration files.
//
// DO NOT EDIT THIS FILE - use system-config-bind or an editor
// to create named.conf - edits to this file will be lost on
// caching-nameserver package upgrade.
//
options {
listen-on port 53 { 10.100.1.10; };
# listen-on-v6 port 53 { ::1; };
directory "/var/named";
dump-file "/var/named/data/cache_dump.db";
statistics-file "/var/named/data/named_stats.txt";
memstatistics-file "/var/named/data/named_mem_stats.txt";

// Those options should be used carefully because they disable port
// randomization
// query-source port 53;
// query-source-v6 port 53;

allow-query { any; };
};
logging {
channel default_debug {
file "data/named.run";
severity dynamic;
};
};
include "/etc/named.rfc1912.zones";


[root@orarmanlab etc]# host orarmanlab.anand.com
orarmanlab.anand.com has address 10.100.1.10

[root@orarmanlab etc]# host 10.100.1.10
Host 10.1.100.10.in-addr.arpa not found: 2(SERVFAIL)

[root@orarmanlab log]# nslookup 10.100.1.10
Server: 10.100.1.10
Address: 10.100.1.10#53

** server can't find 10.1.100.10.in-addr.arpa: SERVFAIL


From /var/log/messages

Jul 19 05:56:07 orarmanlab named[4559]: starting BIND 9.3.4-P1 -u named -t /var/named/chroot
Jul 19 05:56:07 orarmanlab named[4559]: found 1 CPU, using 1 worker thread
Jul 19 05:56:07 orarmanlab named[4559]: loading configuration from '/etc/named.conf'
Jul 19 05:56:07 orarmanlab named[4559]: listening on IPv4 interface eth0, 10.100.1.10#53
Jul 19 05:56:07 orarmanlab named[4559]: command channel listening on 127.0.0.1#953
Jul 19 05:56:07 orarmanlab named[4559]: command channel listening on ::1#953
Jul 19 05:56:07 orarmanlab named[4559]: zone 0.in-addr.arpa/IN: loaded serial 42
Jul 19 05:56:07 orarmanlab named[4559]: zone 10.1.100.in-addr.arpa/IN: loaded serial 1997022700
Jul 19 05:56:07 orarmanlab named[4559]: zone 255.in-addr.arpa/IN: loaded serial 42
Jul 19 05:56:07 orarmanlab named[4559]: zone 0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa/IN: loaded serial 1997022700
Jul 19 05:56:07 orarmanlab named[4559]: zone anand.com/IN: loaded serial 42
Jul 19 05:56:07 orarmanlab named[4559]: zone localhost/IN: loaded serial 42
Jul 19 05:56:07 orarmanlab named[4559]: running
 
Old 07-18-2013, 10:09 PM   #4
anandr4u
LQ Newbie
 
Registered: Jul 2013
Location: India
Distribution: RHEL
Posts: 6

Original Poster
Rep: Reputation: Disabled
[root@orarmanlab etc]# named -v
BIND 9.3.4-P1
[root@orarmanlab etc]#

[root@orarmanlab etc]# cat /etc/*release
Red Hat Enterprise Linux Server release 5.3 (Tikanga)
[root@orarmanlab etc]#
 
Old 07-19-2013, 09:26 AM   #5
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,975

Rep: Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343
Quote:
The reverse.zone file is getting read but it seems there is some issue with the scripting inside reverse.zone.
The zone file of the reverse zone looks fine, but maybe there is something that is not visible at a first place.
Anyway create a new zone file and copy/paste the following data:
Code:
$ORIGIN 10.1.100.in-addr.arpa.
$TTL 86400
@ IN SOA orarmanlab.anand.com. root.orarmanlab.anand.com. (
2013071901 ; Serial
28800 ; Refresh
14400 ; Retry
3600000 ; Expire
86400 ) ; Minimum
     IN NS orarmanlab.anand.com.
10 IN PTR orarmanlab.anand.com.
 
Old 07-21-2013, 10:08 PM   #6
anandr4u
LQ Newbie
 
Registered: Jul 2013
Location: India
Distribution: RHEL
Posts: 6

Original Poster
Rep: Reputation: Disabled
Reverse Lookup still not working.....

Created a New Reverse Zone File. Even i changed the IP from 10.100.1.10 to 10.100.1.121.

Quote:
[root@orarmanlab log]# cd /var/named/chroot/var/named

[root@orarmanlab named]# ls -lrt
total 96
drwxrwx--- 2 named named 4096 Jul 27 2004 slaves
-rw-r----- 1 root named 427 Jan 6 2009 named.zero
-rw-r----- 1 root named 426 Jan 6 2009 named.local
-rw-r----- 1 root named 424 Jan 6 2009 named.ip6.local
-rw-r----- 1 root named 1892 Jan 6 2009 named.ca
-rw-r----- 1 root named 427 Jan 6 2009 named.broadcast
-rw-r----- 1 root named 195 Jan 6 2009 localhost.zone
-rw-r----- 1 root named 198 Jan 6 2009 localdomain.zone
drwxrwx--- 2 named named 4096 Jul 14 20:50 data
-rw-r----- 1 root named 258 Jul 19 07:20 forward.zone
-rw-r----- 1 root named 502 Jul 19 07:20 old_reverse.zone
-rw-r--r-- 1 root named 253 Jul 22 07:13 reverse.zone

[root@orarmanlab named]# more reverse.zone
$ORIGIN 10.1.100.in-addr.arpa.
$TTL 86400
@ IN SOA orarmanlab.anand.com. root.orarmanlab.anand.com. (
2013071901 ; Serial
28800 ; Refresh
14400 ; Retry
3600000 ; Expire
86400 ) ; Minimum
IN NS orarmanlab.anand.com.
121 IN PTR orarmanlab.anand.com.
[root@orarmanlab named]#
Quote:
[root@orarmanlab ~]# service named status
number of zones: 6
debug level: 0
xfers running: 0
xfers deferred: 0
soa queries in progress: 0
query logging is OFF
recursive clients: 0/1000
tcp clients: 0/100
server is up and running
named (pid 3559) is running...
Quote:
[root@orarmanlab ~]# nslookup orarmanlab
Server: 10.100.1.121
Address: 10.100.1.121#53

Name: orarmanlab.anand.com
Address: 10.100.1.121
Quote:
[root@orarmanlab ~]# nslookup orarmanlab.anand.com
Server: 10.100.1.121
Address: 10.100.1.121#53

Name: orarmanlab.anand.com
Address: 10.100.1.121
Quote:
[root@orarmanlab ~]# nslookup 10.100.1.121
Server: 10.100.1.121
Address: 10.100.1.121#53

** server can't find 121.1.100.10.in-addr.arpa: SERVFAIL

[root@orarmanlab ~]# dig -x 10.100.1.121

; <<>> DiG 9.3.4-P1 <<>> -x 10.100.1.121
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 41483
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;121.1.100.10.in-addr.arpa. IN PTR

;; Query time: 11 msec
;; SERVER: 10.100.1.121#53(10.100.1.121)
;; WHEN: Mon Jul 22 07:30:09 2013
;; MSG SIZE rcvd: 43
 
Old 07-22-2013, 03:42 AM   #7
anandr4u
LQ Newbie
 
Registered: Jul 2013
Location: India
Distribution: RHEL
Posts: 6

Original Poster
Rep: Reputation: Disabled
It seems i did a mistake while putting the IP in reverse during the zone file configuration.Reversed IP available in the current zone files are completely wrong. Realized it now only. Will change it once at home and re check. Hope that will solve the issue.
 
Old 07-22-2013, 04:13 AM   #8
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,975

Rep: Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343
Quote:
Originally Posted by anandr4u View Post
It seems i did a mistake while putting the IP in reverse during the zone file configuration.Reversed IP available in the current zone files are completely wrong. Realized it now only. Will change it once at home and re check. Hope that will solve the issue.
Oops you're right. I've missed that one!
You should also leave at least a blank space at the beginning of the NS RR line. That's why I told you to copy/paste the zone file above.
 
1 members found this post helpful.
Old 07-22-2013, 09:15 PM   #9
anandr4u
LQ Newbie
 
Registered: Jul 2013
Location: India
Distribution: RHEL
Posts: 6

Original Poster
Rep: Reputation: Disabled
Thanks..It Worked..

Quote:
Originally Posted by bathory View Post
Oops you're right. I've missed that one!
You should also leave at least a blank space at the beginning of the NS RR line. That's why I told you to copy/paste the zone file above.
Now its working. The way i put the reverse IP in Zone files was the issue. But with this mistake i learnt a lot about BIND. Thanks for your help and time. Really appreciated.

Quote:
[root@orarmanlab named]# nslookup orarmanlab
Server: 10.100.1.121
Address: 10.100.1.121#53

Name: orarmanlab.anand.com
Address: 10.100.1.121

[root@orarmanlab named]# nslookup orarmanlab.anand.com
Server: 10.100.1.121
Address: 10.100.1.121#53

Name: orarmanlab.anand.com
Address: 10.100.1.121

[root@orarmanlab named]# nslookup 10.100.1.121
Server: 10.100.1.121
Address: 10.100.1.121#53

121.1.100.10.in-addr.arpa name = orarmanlab.anand.com.

[root@orarmanlab named]# dig -x 10.100.1.121

; <<>> DiG 9.3.4-P1 <<>> -x 10.100.1.121
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 45986
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 1

;; QUESTION SECTION:
;121.1.100.10.in-addr.arpa. IN PTR

;; ANSWER SECTION:
121.1.100.10.in-addr.arpa. 86400 IN PTR orarmanlab.anand.com.

;; AUTHORITY SECTION:
1.100.10.in-addr.arpa. 86400 IN NS orarmanlab.anand.com.

;; ADDITIONAL SECTION:
orarmanlab.anand.com. 86400 IN A 10.100.1.121

;; Query time: 0 msec
;; SERVER: 10.100.1.121#53(10.100.1.121)
;; WHEN: Tue Jul 23 06:41:42 2013
;; MSG SIZE rcvd: 107

[root@orarmanlab named]#
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Bind reverse lookup mattyg007 Linux - Networking 1 12-08-2011 01:11 PM
[SOLVED] bind reverse zone; no name with reverse lookup deadeyes Linux - Server 3 10-12-2009 10:54 AM
Bind and reverse lookup, something ain't right. Sizam Linux - Networking 1 04-25-2005 07:51 PM
bind reverse lookup thesnaggle Linux - Software 1 03-11-2004 07:19 PM
Bind reverse lookup Kostko Linux - Networking 2 12-07-2002 10:06 AM


All times are GMT -5. The time now is 02:02 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration