LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   dns problem (https://www.linuxquestions.org/questions/linux-newbie-8/dns-problem-4175505088/)

sachin.davra 05-15-2014 09:02 AM

dns problem
 
Hi,

I am using centos6 x86. i have configured named service in that machine and i have some local clients machine which uses named service provided by that machine. i have put an entry for every client machine and for some other location internal servers also but reverse lookup doesn't work only for outside server. Could anyone help please.

MensaWater 05-15-2014 09:11 AM

Not enough information.

What is in your named.conf on the DNS server for the reverse zone (arpa.x.x.x usually).

What does the reverse zone file contain?

Do your clients have the IP of this DNS server in /etc/resolv.conf?

Do the client have DNS specified in /etc/nsswitch.conf?

sachin.davra 05-16-2014 01:07 AM

Quote:

Originally Posted by MensaWater (Post 5171376)
Not enough information.

What is in your named.conf on the DNS server for the reverse zone (arpa.x.x.x usually).

What does the reverse zone file contain?

Do your clients have the IP of this DNS server in /etc/resolv.conf?

Do the client have DNS specified in /etc/nsswitch.conf?

Answer for 1.
Code:

zone "0.168.192.in-addr.arpa" IN {
        type master;
        file "rev_0.zone";
};

Answer for 2.
Code:

[root@GAIDL-5001 ~]# cat /var/named/rev_0.zone
$TTL 1D
@        IN SOA        GAIDL-5001.gai.net. root.GAIDL-5001.gai.net. (
                                        0        ; serial
                                        1D        ; refresh
                                        1H        ; retry
                                        1W        ; expire
                                        3H )        ; minimum
@        IN        NS        GAIDL-5001.gai.net.

125        IN        PTR        support.gai.net.
125        IN        PTR        alps.gai.net.
[root@GAIDL-5001 ~]#

Answer for 3.
Code:

[root@GAIDL-5001 ~]# cat /etc/resolv.conf
nameserver 192.168.50.1
search gai.net
[root@GAIDL-5001 ~]#

Could you help me with question number 4.

MensaWater 05-16-2014 09:47 AM

or my 4th question I was talking about nsswitch.conf (usually /etc/nsswitch.conf). This file determines where to lookup certain information and which order to lookup.

Specifically it can have entry for "hosts" such as:
hosts: db files nisplus nis dns
Or:
hosts: files dns
The first entry says to search a local database first, then "files" (which would be /etc/hosts for UNIX/Linux), then nisplus, then nis then dns. It will stop once any of those give the answer.
The second entry which is more common says to simply first search "files" and if not found search "dns".
You'd only have one uncommented "hosts:" line.

If "files" is in nsswitch.conf for "hosts:" line verify you don't have 192.168.0.125 in /etc/hosts on the client.

From what you originally wrote I'm assuming your forward lookups are working and it is only the reverse that isn't.

Can you connect to port 53 on your nameserver from your client servers?

Does the name server have itself (or "localhost") in its own resolv.conf. If so does dig -x 192.168.0.125 give the correct value when run on the name server itself?

What does the dig -x give when run from the client?

Does "dig -x @192.168.50.1 192.168.0.125" give a different value? than the dig without the @192.168.50.1.

Given that your nameserver is 192.168.50 should your arpa be 192.168.0 or should it be 192.168.50? That is are you actually trying to resolve 192.168.50.125 rather than 192.168.0.125 as implied by your current arpa zone?

sachin.davra 05-19-2014 02:26 AM

Quote:

Originally Posted by MensaWater (Post 5172086)
or my 4th question I was talking about nsswitch.conf (usually /etc/nsswitch.conf). This file determines where to lookup certain information and which order to lookup.

Specifically it can have entry for "hosts" such as:
hosts: db files nisplus nis dns
Or:
hosts: files dns
The first entry says to search a local database first, then "files" (which would be /etc/hosts for UNIX/Linux), then nisplus, then nis then dns. It will stop once any of those give the answer.
The second entry which is more common says to simply first search "files" and if not found search "dns".
You'd only have one uncommented "hosts:" line.

If "files" is in nsswitch.conf for "hosts:" line verify you don't have 192.168.0.125 in /etc/hosts on the client.

From what you originally wrote I'm assuming your forward lookups are working and it is only the reverse that isn't.

Can you connect to port 53 on your nameserver from your client servers?

Does the name server have itself (or "localhost") in its own resolv.conf. If so does dig -x 192.168.0.125 give the correct value when run on the name server itself?

What does the dig -x give when run from the client?

Does "dig -x @192.168.50.1 192.168.0.125" give a different value? than the dig without the @192.168.50.1.

Given that your nameserver is 192.168.50 should your arpa be 192.168.0 or should it be 192.168.50? That is are you actually trying to resolve 192.168.50.125 rather than 192.168.0.125 as implied by your current arpa zone?




In nsswitch.conf

Code:

hosts:      files dns

Code:

[root@GAIDL-5001 ~]# dig -x 192.168.0.125

; <<>> DiG 9.8.2rc1-RedHat-9.8.2-0.17.rc1.el6_4.6 <<>> -x 192.168.0.125
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 30251
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0

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

;; Query time: 0 msec
;; SERVER: 192.168.50.1#53(192.168.50.1)
;; WHEN: Mon May 19 12:53:58 2014
;; MSG SIZE  rcvd: 44

[root@GAIDL-5001 ~]#

from client machine

Code:

[sachin.davra@GAIDL-5015 Desktop]$ dig -x 192.168.0.125

; <<>> DiG 9.8.2rc1-RedHat-9.8.2-0.17.rc1.el6_4.6 <<>> -x 192.168.0.125
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 57116
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0

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

;; Query time: 6 msec
;; SERVER: 192.168.50.1#53(192.168.50.1)
;; WHEN: Mon May 19 12:55:16 2014
;; MSG SIZE  rcvd: 44

Code:

[sachin.davra@GAIDL-5015 Desktop]$ dig -x 192.168.50.1

; <<>> DiG 9.8.2rc1-RedHat-9.8.2-0.17.rc1.el6_4.6 <<>> -x 192.168.50.1
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 21342
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 1

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

;; ANSWER SECTION:
1.50.168.192.in-addr.arpa. 86400 IN        PTR        GAIDL-5001.gai.net.

;; AUTHORITY SECTION:
50.168.192.in-addr.arpa. 86400        IN        NS        GAIDL-5001.gai.net.

;; ADDITIONAL SECTION:
GAIDL-5001.gai.net.        10800        IN        A        192.168.50.1

;; Query time: 0 msec
;; SERVER: 192.168.50.1#53(192.168.50.1)
;; WHEN: Mon May 19 12:55:45 2014
;; MSG SIZE  rcvd: 105


How should correct it? Kindly help.

MensaWater 05-19-2014 03:42 PM

What zone file contains the record for GAIDL-5001.gai.net that you got the reverse to work on above? It isn't in the one you previously posted.

sachin.davra 05-20-2014 01:57 AM

Quote:

Originally Posted by MensaWater (Post 5173775)
What zone file contains the record for GAIDL-5001.gai.net that you got the reverse to work on above? It isn't in the one you previously posted.

Actually in my named.conf file i have configured forward lookup zone for one domain and reverse lookup zone for 3 different networks.
Two of them are working for reverse lookup and forward lookup zone is also working fine but only reverse lookup zone is not working. I rechecked named.conf file and zone file also. every thing is same as for other zone files.

GAIDL-5001.gai.net is configured in one of the reverse lookup and forward lookup zone.

Please tell me if you require any log info.

sachin.davra 05-20-2014 03:24 AM

Thanks guys for your time. Actually problem was in permission of zone files. I changed the owner of that zone to named:named which was not working and reloaded the config and zone files. Now it is working fine.


All times are GMT -5. The time now is 03:25 PM.