1753599 Members
6712 Online
108796 Solutions
New Discussion юеВ

DNS forward lookup

 
KIM D NGUYEN
Occasional Contributor

DNS forward lookup

Hello there

I am running in to a problem with DNS forward lookup. The reverse lookup is working fine. It resolves IP address to hostname but the forward lookup it resolves hostname to IP address from the hosts file. Here is the situation.

We have a cluster of servers: server1, server2, server3, server4. DNS server is running on server4. Originally, we have 6 domains such as:

ExampleA.com
ExampleB.com
ExampleC.com
ExampleD.com
ExampleE.com
ExampleF.com

Now we added more domains:

ExampleG.com
ExampleH.com
ExampleK.com
ExampleL.com
ExampleM.com
ExampleN.com

We also added new hosts to the existing domain (ExampleA.com, ExampleB.com, ExampleC.com, ExampleD.com, ExampleE.com, and ExampleF.com). DNS lookup is working fine both forward and reverse lookup for the existing domain. It doesnтАЩt have any problems but when I performed nslookup for the new host on the new domain below:

ExampleG.com,
ExampleH.com
ExampleK.com
ExampleL.com
ExampleM.com
ExampleN.com

I encountered the problem. DNS lookup resolves IP address to hostname but doesnтАЩt resolve hostname to IP address. It resolves IP address from the host file.

*** Here is the result of forward lookup****
#nslookup
Default name server: server4.ExampleA.com
Address: 135.10.143.54
>host01
Name Server: server4.ExampleA.com
Address: 135.10.143.54
Trying DNS
Looking up FILES
Name: host01.ExampleG.com
Address: 135.10.240.69
Alliases: host01

*** Here is the result of reverse lookup (It works perfect)****
>135.10.240.69
Name Server: server4.ExampleA.com
Address: 135.10.143.54

Trying DNS
Name: host01.ExampleG.com
Address: 135.10.240.69


Here are the files in
server1:
/etc/nsswith.conf
/etc/resolve.conf
/etc/hosts

server2:
/etc/nsswith.conf
/etc/resolve.conf
/etc/hosts

server3:
/etc/nsswith.conf
/etc/resolve.conf
/etc/hosts

server4:
/etc/nsswith.conf
/etc/resolve.conf
/etc/hosts

/tmp/param

Here is the nsswitch.conf
#
# /etc/nsswitch.nis:
#
# @(#)B.11.11_LR
#
# An example file that could be copied over to /etc/nsswitch.conf; it
# uses NIS (YP) in conjunction with files.
#

passwd: files ldap
group: files ldap
hosts: dns files [NOTFOUND=Continue]
networks: nis [NOTFOUND=return] files
protocols: nis [NOTFOUND=return] files
rpc: nis [NOTFOUND=return] files
publickey: nis [NOTFOUND=return] files
netgroup: nis [NOTFOUND=return] files
automount: files nis
aliases: files nis
services: files nis

Here is the resolv.conf
domain ExampleA.com
search ExampleA.com ExampleB.com ExampleC.com ExampleD.com ExampleE.com ExampleF.com ExampleG.com ExampleH.com ExampleK.com ExampleL.com ExampleM.com ExampleN.com

nameserver 135.10.143.54
nameserver 135.10.129.54

Here is param file in /tmp/param

-d ExampleA.com
-d ExampleB.com
-d ExampleC.com
-d ExampleD.com
-d ExampleE.com
-d ExampleF.com
-d ExampleG.com
-d ExampleH.com
-d ExampleK.com
-d ExampleL.com
-d ExampleM.com
-d ExampleN.com
-n 135.10.129
-n 135.10.135
-n 135.10.143
-n 135.10.192
-n 135.10.193
-n 135.10.194
-n 135.10.200
-n 135.10.201
-n 135.10.205
-n 135.10.206
-n 135.10.210
-n 135.10.250
-H /etc/hosts

Would you please help? Thank you very much.

Sincerely,
Kim















2 REPLIES 2
TTr
Honored Contributor

Re: DNS forward lookup

In your forward nslookup example you typed in "host01" as a simple name (not FQDN). So it inherited the default domain of the host where you run the nslookup command. Based on the resolv.conf file it is ExampleA.com. So the host01 is treated as host01.ExampleA.com

What do you expect the result to be?

The resolv.conf assumes a ExampleA.com so is the host01 listed in the map for that domain?

Which domains is host01 listed in?

If all the resolv.conf files have "domain ExampleA.com" what is the point of all the other domains?
KIM D NGUYEN
Occasional Contributor

Re: DNS forward lookup

Thank you for quick reply.

We found out the limitation of the character searching of BIND 9.3.2. The maximum character searching is 250 characters beyond 250 characters it will drop. That is the reason the new domains added when we tried to resolve the hostname to IP address. It returned the hostname to IP address from the host file. It works only if we tried to resolve FQDN it will resolve hostname to IP address from the DNS server. We have total 17 domains in the resolv.conf. The 1st 6 domains, we do nslookup only hostname (i.e host01). It will resolve the IP address from the DNS server:
├п ┬з Example:
├в ┬в For the 1st 6 domain in the resolv.conf
nslookup by hostname:
#nslookup
Default name server: server4.exampleA.com
Address: 135.18.129.54
>server1
Name Server: server4.exampleA.com
Address: 135.18.129.54
Trying DNS
Name: server1.exampleB.com
Address: 135.18.143.54

├в ┬в For the rest domains in the resolv.conf (7th domain to 17th domain)
nslookup by FQDN:
#nslookup
Default name server: server4.exampleA.com
Address: 135.18.129.54
>host01.exampleM.com
Name Server: server4.exampleA.com
Address: 135.18.129.54
Trying DNS
Address: host01.exampleM.com
Address: 135.18.129.54
├в ┬в If we tried to resolve hostname to IP address(7th domain to 17th domain), it will resolve IP address from the host file but not on DNS server.

#nslookup
Default name server: server4.exampleA.com
Address: 135.18.129.54
>host01
Name Server: server4.exampleA.com
Address: 135.18.129.54
Trying DNS
Looking up FILES
Address: host01.exampleM.com
Address: 135.18.129.54
Alias: host01