Operating System - Linux
1753876 Members
7529 Online
108809 Solutions
New Discussion юеВ

Re: NAME RESOLUTION ISSUE

 
pkumar97
Frequent Advisor

NAME RESOLUTION ISSUE

Dear Team,
i am facing an issue with NAME resolution in one of my Linux box, when i am trying for an nslookup command it is not resolving and it is going and trying to resolve the service provider ip address.

MY LINUX IS CENTOS

i have an hp ux box ip address is 192.168.5.11 and host name is aagcapp also i have a linux box whose hostname is agi_proxy whose ip address is 192.168.5.99

-bash-3.2# nslookup aagcapp
Server: 213.42.20.20
Address: 213.42.20.20#53

** server can't find aagcapp: NXDOMAIN

-bash-3.2# nslookup 192.168.5.11
Server: 213.42.20.20
Address: 213.42.20.20#53

** server can't find 11.5.168.192.in-addr.arpa: NXDOMAIN

-bash-3.2# nslookup agi_proxy
Server: 213.42.20.20
Address: 213.42.20.20#53

** server can't find agi_proxy: NXDOMAIN

-bash-3.2# nslookup 192.168.5.99
Server: 213.42.20.20
Address: 213.42.20.20#53

** server can't find 99.5.168.192.in-addr.arpa: NXDOMAIN

-bash-3.2# ping agi_proxy
PING agi_proxy.aagc.corp (192.168.5.99) 56(84) bytes of data.


--- agi_proxy.aagc.corp ping statistics ---
14 packets transmitted, 0 received, 100% packet loss, time 13007ms

-bash-3.2# ping 192.168.5.99
PING 192.168.5.99 (192.168.5.99) 56(84) bytes of data.

--- 192.168.5.99 ping statistics ---
4 packets transmitted, 0 received, 100% packet loss, time 3023ms

-bash-3.2# cat /etc/hosts
127.0.0.1 localhost.localdomain localhost
#192.168.5.100 agiproxy
192.168.5.14 agibkpp.aagc.corp
#192.168.5.11 aagcapp
192.168.5.99 agi_proxy.aagc.corp agi_proxy
192.168.5.10 aagcapp.aagc.corp aagcapp



-bash-3.2# cat /etc/resolv.conf
#domain aagc.corp
nameserver 213.42.20.20
nameserver 192.168.5.101

when ever i am trying for an nslookup command from agi_proxy the hostname or ip address is not resolving
what could be the reason for this ..
4 REPLIES 4
Matti_Kurkela
Honored Contributor

Re: NAME RESOLUTION ISSUE

In CentOS Linux, the default nslookup will check DNS only, not /etc/hosts.

Since your /etc/resolv.conf file has the "domain" line commented out, nslookup will assume you're trying to look up top-level names, like ".com", ".org" or ".ae". Of course a top-level domain ".agi_proxy" does not exist, so the response is "NXDOMAIN" (= Non-eXistent Domain).

You should try nslookup using the fully-qualified names:

# nslookup agi_proxy.aagc.corp

# nslookup aagcapp.aagc.corp

If these commands will also produce a NXDOMAIN response, you should talk to the administrators of your nameservers (the systems with IP addresses 192.168.5.101 and 213.42.20.20). Perhaps those names have not been registered to DNS at all?

If you need or want to use short names, uncomment the "domain" line in your /etc/resolv.conf. That would tell your system to always assume that unqualified names should refer to the .aagc.corp domain.

On the other hand, your ping command uses /etc/hosts too, so it has resolved the IP address successfully here:

>bash-3.2# ping agi_proxy
>PING agi_proxy.aagc.corp (192.168.5.99) 56(84) bytes of data.

... but it also indicates you apparently don't have network connectivity to agi_proxy, since it got no response at all:

>--- agi_proxy.aagc.corp ping statistics ---
>14 packets transmitted, 0 received, 100% packet loss, time 13007ms

(It might also mean that agi_proxy is configured to not respond to ping requests, or that there is a firewall between you and agi_proxy that blocks pings.)

The "hosts:" line in /etc/nsswitch.conf will determine whether tools like ping use /etc/hosts or DNS as their primary way to resolve names.

MK
MK
pkumar97
Frequent Advisor

Re: NAME RESOLUTION ISSUE

Thanks alot sir, now we i can do the following things ie from agi_proxy.aagc.corp ( linux server) i can resolve its host name and ip address. But from the same server when i am trying to resolve the clients hostname and ipaddress again we are getting the same error , please find the attached details
-bash-3.2# nslookup agi_proxy
Server: 192.168.5.101
Address: 192.168.5.101#53

Name: agi_proxy.aagc.corp
Address: 192.168.5.99

-bash-3.2# nslookup aagcapp.aagc.corp
Server: 192.168.5.101
Address: 192.168.5.101#53

** server can't find aagcapp.aagc.corp: NXDOMAIN

-bash-3.2# nslookup 192.168.5.99
Server: 192.168.5.101
Address: 192.168.5.101#53

99.5.168.192.in-addr.arpa name = agi_proxy.aagc.corp.

-bash-3.2# nslookup 192.168.5.10
Server: 192.168.5.101
Address: 192.168.5.101#53

** server can't find 10.5.168.192.in-addr.arpa: NXDOMAIN

-bash-3.2# cat /etc/resolv.conf
search aagc.corp
nameserver 192.168.5.101
nameserver 213.42.20.20
-bash-3.2# ping aagcapp.aagc.corp
PING aagcapp.aagc.corp (192.168.5.10) 56(84) bytes of data.
64 bytes from aagcapp.aagc.corp (192.168.5.10): icmp_seq=1 ttl=255 time=7.47 ms
64 bytes from aagcapp.aagc.corp (192.168.5.10): icmp_seq=2 ttl=255 time=0.106 ms

--- aagcapp.aagc.corp ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1011ms
rtt min/avg/max/mdev = 0.106/3.791/7.477/3.686 ms
-bash-3.2#
pkumar97
Frequent Advisor

Re: NAME RESOLUTION ISSUE

Also see the /etc/host entry , /etc/resolve.conf

-bash-3.2# cat resolv.conf
search aagc.corp
nameserver 192.168.5.101
nameserver 213.42.20.20
-bash-3.2#

-bash-3.2# cat /etc/hosts
127.0.0.1 localhost.localdomain localhost
#192.168.5.100 agiproxy
192.168.5.14 agibkpp.aagc.corp
#192.168.5.11 aagcapp
192.168.5.99 agi_proxy.aagc.corp agi_proxy
192.168.5.10 aagcapp.aagc.corp aagcapp

/etc/nsswitch.conf

# Example:
#passwd: db files nisplus nis
#shadow: db files nisplus nis
#group: db files nisplus nis

passwd: files
shadow: files
group: files

#hosts: db files nisplus nis dns
hosts: files dns

# Example - obey only what nisplus tells us...
#services: nisplus [NOTFOUND=return] files
#networks: nisplus [NOTFOUND=return] files
#protocols: nisplus [NOTFOUND=return] files
#rpc: nisplus [NOTFOUND=return] files
#ethers: nisplus [NOTFOUND=return] files
#netmasks: nisplus [NOTFOUND=return] files

bootparams: nisplus [NOTFOUND=return] files

ethers: files
netmasks: files
networks: files
protocols: files
rpc: files
services: files

netgroup: nisplus

publickey: nisplus

automount: files nisplus
aliases: files nisplus


Matti_Kurkela
Honored Contributor

Re: NAME RESOLUTION ISSUE

OK, now it looks like ag_proxy has a valid name registration in the DNS system. Apparently you fixed the domain line in /etc/resolv.conf too, because short names are also working.

The name -> IP lookup (regular, or "forward" DNS lookup) works for agi_proxy:

>-bash-3.2# nslookup agi_proxy
>Server: 192.168.5.101
>Address: 192.168.5.101#53
>
>Name: agi_proxy.aagc.corp
>Address: 192.168.5.99

The IP -> name lookup (= reverse DNS lookup) seems to work too:

>-bash-3.2# nslookup 192.168.5.99
>Server: 192.168.5.101
>Address: 192.168.5.101#53
>
>99.5.168.192.in-addr.arpa name = agi_proxy.aagc.corp.

But the aagcapp system is apparently not registered to DNS at all:

>-bash-3.2# nslookup aagcapp.aagc.corp
>Server: 192.168.5.101
>Address: 192.168.5.101#53
>
>** server can't find aagcapp.aagc.corp: NXDOMAIN

Find the DNS administrator of the aagc.corp domain, and ask him/her to add the name and IP address of aagcapp to the aagc.corp zone. Unless you are the administrator of the aagc.corp DNS zone, you *cannot* fix this yourself.

If the aagc.corp zone uses classic manual updates, then the DNS administrator can fix the problem. If the zone uses some sort of dynamic DNS update mechanism, then the DNS administrator can check the logs of the DNS servers to see why aagcapp has not been registered to DNS.

The ping command works because /etc/hosts includes the correct IP address for aagcapp. But the purpose of DNS is to remove the requirement to add all hosts to /etc/hosts files of all other hosts.

MK
MK