Reverse lookup not resolving IP to Name.
I have configured Bind 9 in my test lab using class c .I can successfully dig pc1 as following.
[root@mainserver ~]# dig A pc1.mydomain.com ; <<>> DiG 9.2.4 <<>> A pc1.mydomain.com ;; global options: printcmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 61797 ;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 1 ;; QUESTION SECTION: ;pc1.mydomain.com. IN A ;; ANSWER SECTION: pc1.mydomain.com. 86400 IN A 192.168.1.1 ;; AUTHORITY SECTION: mydomain.com. 86400 IN NS mainserver.mydomain.com. ;; ADDITIONAL SECTION: mainserver.mydomain.com. 86400 IN A 192.168.1.254 ;; Query time: 363 msec ;; SERVER: 127.0.0.1#53(127.0.0.1) ;; WHEN: Fri Jul 23 01:51:28 2010 ;; MSG SIZE rcvd: 91 but when i try to use reverse lookup it does't give me ans. [root@mainserver ~]# dig -x 192.168.1.1 ; <<>> DiG 9.2.4 <<>> -x 192.168.1.1 ;; global options: printcmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 56468 ;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0 ;; QUESTION SECTION: ;1.1.168.192.in-addr.arpa. IN PTR ;; Query time: 77 msec ;; SERVER: 127.0.0.1#53(127.0.0.1) ;; WHEN: Mon Jul 26 19:49:55 2010 ;; MSG SIZE rcvd: 42 My /etc/resolve file is as search mydomain.com nameserver 192.168.1.254 Please guide that how can I fix this issue. thanks garden |
reverse lookup is a separate zone and needs to be configured as such in bind. for IPv4, use a zone named z.y.x.in-addr.arpa. pointing to a zone-file with PTR records for each value of n, where x.y.z.n is the full dotted IPv4-address.
example: zone: 0.168.192.in-addr.arpa -> file rev-lan.db zonefile: 1 IN PTR foo.example.org. makes 192.168.0.1 resolve to foo.example.org Don't forget the trailing dot in a PTR record to make it "absolute". |
in \etc\named.conf file
zone “1.168.192.in-addr.arpa” IN { type master; file “mydomain.com.rev” ; allow-update {none; }; }; and my reverse life is as [root@mainserver named]#vi@mydomain.com.rev PHP Code:
|
Uhm .. I spot a lot of little errors like "ORIGIN" instead of "$ORIGIN", "in.addr" instead of "in-addr" ... and the file ends after a "PTR"? ... this record lacks a hostname!
Btw, you do NOT need to write the full thing like "1.1.168.192.in.addr.arpa." if $ORIGIN is set appropriately -- it will be appended automatically, so just "1" would be enough. |
sorry,in my linux box there was already $ORIGIN i forget to write here in my post.
Please specify with code where is an error. $ORIGIN 1.168.192.in.addr.arpa. is it correct ? should be too much thankful. |
Quote:
- "in.addr" instead of "in-addr" - nothing after the "PTR", so this address points to nothing -- you need to put a FQDN after PTR, with trailing dot. And, the whole IP-address is unnecessary here, "1" instead of "1.1.168.192.in-addr.arpa." would be enough :) |
Quote:
|
thanks a lot "zirias" for the help.I appriciate you. It is now working perfact.
One thing more i want to discuss that what is the role of /etc/resolve my default it was as Code:
search localdomain Code:
search mydomain.com |
It tells your libc where to look for a nameserver inside "gethostbyname()" calls and the like. The parameter "search" is appended automatically to unqualified hostnames, so a gethostbyname('foo'); will really look up "foo.mydomain.com.".
|
from client side how can i test my server ? when i write
Code:
[root@pc1 root] ping www.mydomain.com |
So this client is located inside the same private LAN, otherwise it wouldn't be able to ping a 192.168.0.0/16 address. Just adjust /etc/resolv.conf on this client :)
|
yes it is inside the same network.I should be thankful if you guide me that how can i add the client in /etc/resolv.conf file ?My client address is 192.168.1.1 and the subnet mask is same which is
255.255.255.0 Code:
search mydomain.com in the pc1 i edit the file and it was showing as as Quote:
|
Uhm ... what do you THINK this "pc1" entry should do? the only thing you HAVE to configure in resolv.conf is the IP address of your primary name server. I don't know what it is in your case, just put there the IP where you installed "bind".
|
Code:
Uhm ... what do you THINK this "pc1" entry should do? the only thing you HAVE to configure in resolv.conf is the IP address of your primary name server. I don't know what it is in your case, just put there the IP where you installed "bind". The /etc/resolv.conf file in my bind server is as Code:
search mydomain.com Code:
[root@pc1 root]# dig A mainserver.mydomain.com Kindly help me .....please thanks |
All times are GMT -5. The time now is 02:31 PM. |