LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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 12-03-2009, 11:02 PM   #1
Ravinder Singh Thakur
LQ Newbie
 
Registered: Nov 2009
Posts: 10

Rep: Reputation: 0
DNS server name to ip resolve problem


Dear All,

I have configured the dns server for local environment with domain name of my choice like ns.redhat.com, and ip address of 192.168.20.19 and subnet mask (255.255.255.0).When i run command like nslookup, host, dig to see the reponse of my dns. I get the right answer like show below

1

nslookup 192.168.20.19
Server: 192.168.20.19
Address: 192.168.20.19#53

19.20.168.192.in-addr.arpa name = ns.redhat.com.


2

host 192.168.20.19
19.20.168.192.in-addr.arpa domain name pointer ns.redhat.com.





3
dig -x 192.168.20.19

; <<>> DiG 9.3.6-P1-RedHat-9.3.6-4.P1.el5 <<>> -x 192.168.20.19
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 18529
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 0

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

;; ANSWER SECTION:
19.20.168.192.in-addr.arpa. 86400 IN PTR ns.redhat.com.

;; AUTHORITY SECTION:
20.168.192.in-addr.arpa. 86400 IN NS ns.redhat.com.

;; Query time: 1 msec
;; SERVER: 192.168.20.19#53(192.168.20.19)
;; WHEN: Thu Dec 3 18:50:10 2009
;; MSG SIZE rcvd: 85

But when i ask reverse question to my dns it give follwoing error or response which is not desirable. I mean it should give corresponding ip address of the ns.redhat.com that is 192.168.20.19

1
nslookup ns.redhat.com
Server: 192.168.20.19
Address: 192.168.20.19#53

** server can't find ns.redhat.com: SERVFAIL

2

host ns.redhat.com
Host ns.redhat.com not found: 2(SERVFAIL)


3

dig ns.redhat.com

; <<>> DiG 9.3.6-P1-RedHat-9.3.6-4.P1.el5 <<>> ns.redhat.com
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 51614
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;ns.redhat.com. IN A


;; Query time: 1 msec
;; SERVER: 192.168.20.19#53(192.168.20.19)
;; WHEN: Thu Dec 3 18:53:12 2009
;; MSG SIZE rcvd: 31


These are my named.conf, forward zone and reverse zone files.




cat /etc/named.conf

options {
directory "/var/named";

/*

* If there is a firewall between you and nameservers you want

* to talk to, you might need to uncomment the query-source

* directive below. Previous versions of BIND always asked

* questions using port 53, but BIND 8.1 uses an unprivileged

* port by default.

*/

// query-source address * port 53;

allow-query { localhost; 192.168.20.0/24; };

// query range

allow-transfer { localhost; 192.168.20.0/24; };

// transfer range

allow-recursion { localhost; 192.168.20.0/24; };

// recursion range

};
controls {
inet 127.0.0.1 allow { localhost; } keys { rndckey; };

};
// here is the section for internal informations

view "internal" {
match-clients {

localhost;

192.168.20.0/24;

};

zone "." IN {

type hint;

file "named.ca";

};

zone "redhat.com" IN {

type master;

file "redhat.com.lan";

allow-update { none; };

};

zone "20.168.192.in-addr.arpa" IN {

type master;

file "20.168.192.db";

allow-update { none; };

};

zone "localdomain" IN {

type master;

file "localdomain.zone";

allow-update { none; };

};

zone "localhost" IN {

type master;

file "localhost.zone";

allow-update { none; };

};

zone "0.0.127.in-addr.arpa" IN {

type master;

file "named.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; };

};

};
include "/etc/rndc.key";


Forward Zone File /var/named/redhat.com.lan.



$TTL 86400
@ IN SOA ns.redhat.com. root.ns.redhat.com. (
42 ; serial (d. adams)
3H ; refresh
15M ; retry
1W ; expiry
1D ) ; minimum

IN NS ns.redhat.com.
IN A 192.168.20.19
IN MX 10 ns.redhat.com.

ns.redhat.com. IN A 192.168.20.19




Reverse Zone File /var/named/20.168.192.db


$TTL 86400
@ IN SOA ns.redhat.com. root.redhat.com. (
42 ; serial (d. adams)
3H ; refresh
15M ; retry
1W ; expiry
1D ) ; minimum

IN NS ns.redhat.com.
IN PTR ns.redhat.com.
IN A 255.255.255.0

19 IN PTR ns.redhat.com.



This is my resolv.conf


This is /etc/resolv.conf

nameserver 192.168.20.19



Thankyou in Advance

Last edited by Ravinder Singh Thakur; 12-03-2009 at 11:03 PM.
 
Old 12-04-2009, 12:00 AM   #2
abhandari
LQ Newbie
 
Registered: Dec 2008
Location: NP
Posts: 28

Rep: Reputation: 1
Post

Quote:
Originally Posted by Ravinder Singh Thakur View Post
Dear All,

I have configured the dns server for local environment with domain name of my choice like ns.redhat.com, and ip address of 192.168.20.19 and subnet mask (255.255.255.0).When i run command like nslookup, host, dig to see the reponse of my dns. I get the right answer like show below

1

nslookup 192.168.20.19
Server: 192.168.20.19
Address: 192.168.20.19#53

19.20.168.192.in-addr.arpa name = ns.redhat.com.


2

host 192.168.20.19
19.20.168.192.in-addr.arpa domain name pointer ns.redhat.com.





3
dig -x 192.168.20.19

; <<>> DiG 9.3.6-P1-RedHat-9.3.6-4.P1.el5 <<>> -x 192.168.20.19
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 18529
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 0

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

;; ANSWER SECTION:
19.20.168.192.in-addr.arpa. 86400 IN PTR ns.redhat.com.

;; AUTHORITY SECTION:
20.168.192.in-addr.arpa. 86400 IN NS ns.redhat.com.

;; Query time: 1 msec
;; SERVER: 192.168.20.19#53(192.168.20.19)
;; WHEN: Thu Dec 3 18:50:10 2009
;; MSG SIZE rcvd: 85

But when i ask reverse question to my dns it give follwoing error or response which is not desirable. I mean it should give corresponding ip address of the ns.redhat.com that is 192.168.20.19

1
nslookup ns.redhat.com
Server: 192.168.20.19
Address: 192.168.20.19#53

** server can't find ns.redhat.com: SERVFAIL

2

host ns.redhat.com
Host ns.redhat.com not found: 2(SERVFAIL)


3

dig ns.redhat.com

; <<>> DiG 9.3.6-P1-RedHat-9.3.6-4.P1.el5 <<>> ns.redhat.com
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 51614
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;ns.redhat.com. IN A


;; Query time: 1 msec
;; SERVER: 192.168.20.19#53(192.168.20.19)
;; WHEN: Thu Dec 3 18:53:12 2009
;; MSG SIZE rcvd: 31


These are my named.conf, forward zone and reverse zone files.




cat /etc/named.conf

options {
directory "/var/named";

/*

* If there is a firewall between you and nameservers you want

* to talk to, you might need to uncomment the query-source

* directive below. Previous versions of BIND always asked

* questions using port 53, but BIND 8.1 uses an unprivileged

* port by default.

*/

// query-source address * port 53;

allow-query { localhost; 192.168.20.0/24; };

// query range

allow-transfer { localhost; 192.168.20.0/24; };

// transfer range

allow-recursion { localhost; 192.168.20.0/24; };

// recursion range

};
controls {
inet 127.0.0.1 allow { localhost; } keys { rndckey; };

};
// here is the section for internal informations

view "internal" {
match-clients {

localhost;

192.168.20.0/24;

};

zone "." IN {

type hint;

file "named.ca";

};

zone "redhat.com" IN {

type master;

file "redhat.com.lan";

allow-update { none; };

};

zone "20.168.192.in-addr.arpa" IN {

type master;

file "20.168.192.db";

allow-update { none; };

};

zone "localdomain" IN {

type master;

file "localdomain.zone";

allow-update { none; };

};

zone "localhost" IN {

type master;

file "localhost.zone";

allow-update { none; };

};

zone "0.0.127.in-addr.arpa" IN {

type master;

file "named.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; };

};

};
include "/etc/rndc.key";


Forward Zone File /var/named/redhat.com.lan.



$TTL 86400
@ IN SOA ns.redhat.com. root.ns.redhat.com. (
42 ; serial (d. adams)
3H ; refresh
15M ; retry
1W ; expiry
1D ) ; minimum

IN NS ns.redhat.com.
IN A 192.168.20.19
IN MX 10 ns.redhat.com.

ns.redhat.com. IN A 192.168.20.19




Reverse Zone File /var/named/20.168.192.db


$TTL 86400
@ IN SOA ns.redhat.com. root.redhat.com. (
42 ; serial (d. adams)
3H ; refresh
15M ; retry
1W ; expiry
1D ) ; minimum

IN NS ns.redhat.com.
IN PTR ns.redhat.com.
IN A 255.255.255.0

19 IN PTR ns.redhat.com.



This is my resolv.conf


This is /etc/resolv.conf

nameserver 192.168.20.19



Thankyou in Advance
=====================
Try this...
=====================
$TTL 86400
@ IN SOA ns.redhat.com. root.ns.redhat.com. (
42 ; serial (d. adams)
3H ; refresh
15M ; retry
1W ; expiry
1D ) ; minimum

@ IN A 192.168.20.19
ns IN A 192.168.20.19
IN A 192.168.20.19
IN MX 10 ns.redhat.com.
===============================
 
Old 12-04-2009, 11:55 PM   #3
Ravinder Singh Thakur
LQ Newbie
 
Registered: Nov 2009
Posts: 10

Original Poster
Rep: Reputation: 0
Actually dear this does not work which you tell me above for my dns server it shows follwoing error when i restart named service


/etc/init.d/named restart
Stopping named: [ OK ]
Starting named:
Error in named configuration:
zone redhat.com/IN: has no NS records
internal/redhat.com/IN: bad zone
zone 20.168.192.in-addr.arpa/IN: loaded serial 42
zone localdomain/IN: loaded serial 42
zone localhost/IN: loaded serial 42
zone 0.0.127.in-addr.arpa/IN: loaded serial 1997022700
zone 255.in-addr.arpa/IN: loaded serial 42
zone 0.in-addr.arpa/IN: loaded serial 42
[FAILED]
 
Old 12-05-2009, 07:56 AM   #4
deadeyes
Member
 
Registered: Aug 2006
Posts: 609

Rep: Reputation: 79
Quote:
Originally Posted by Ravinder Singh Thakur View Post
Actually dear this does not work which you tell me above for my dns server it shows follwoing error when i restart named service


/etc/init.d/named restart
Stopping named: [ OK ]
Starting named:
Error in named configuration:
zone redhat.com/IN: has no NS records
internal/redhat.com/IN: bad zone
zone 20.168.192.in-addr.arpa/IN: loaded serial 42
zone localdomain/IN: loaded serial 42
zone localhost/IN: loaded serial 42
zone 0.0.127.in-addr.arpa/IN: loaded serial 1997022700
zone 255.in-addr.arpa/IN: loaded serial 42
zone 0.in-addr.arpa/IN: loaded serial 42
[FAILED]
Your reverse file, I think you should change it like something like this:

$TTL 86400
@ IN SOA ns.redhat.com. root.redhat.com. (
42 ; serial (d. adams)
3H ; refresh
15M ; retry
1W ; expiry
1D ) ; minimum

IN NS ns.redhat.com.

19 IN PTR ns.redhat.com.

I have something like this configured on my server.
 
  


Reply



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
dns client cannot resolve on dns server jtvillegas Linux - Software 3 03-12-2016 03:30 PM
dns server not able to resolve local domain names mystika08 Linux - Networking 62 07-01-2009 05:23 AM
DNS server unable to resolve uk.ibm.com avijitp Linux - Server 4 05-01-2009 09:35 PM
dns server not able to resolve local domain names mystika08 Linux - Newbie 3 03-19-2009 07:57 AM
HELP! Caching DNS server wont resolve .EDU domains? spadesmaster Linux - Networking 0 04-30-2002 10:25 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 05:58 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
Open Source Consulting | Domain Registration