1819927 Members
3176 Online
109607 Solutions
New Discussion юеВ

Revers DNS lookup

 
SOLVED
Go to solution
Sergejs Svitnevs
Honored Contributor

Revers DNS lookup

Hello

Our app server tries to reverse lookup the connection query to find out the server name and all requests to that server are delayed by 10-15 sec.

Unfortunately, I can not change outdated reverse lookup records in DNS and can not disable reverse dns lookup for my app. Is it possible to manage private Reverse IP lookups through files contained simple list of computer names and associated static IP?

Thanks
8 REPLIES 8
Alex Lavrov.
Honored Contributor

Re: Revers DNS lookup

Yep,

just populate your /etc/hosts file with the entries and make sure that in /etc/nsswitch.conf in hosts line files comes first.

This way it will first check in files and it will be very fast.

Alex.
I don't give a damn for a man that can only spell a word one way. (M. Twain)
Muthukumar_5
Honored Contributor

Re: Revers DNS lookup

Basic setup to use /etc/hosts file with hosts: entry setting in /etc/nsswitch.conf.

Change hosts: entry as,

-- /etc/nsswitch.conf --
hosts: files

-- /etc/hosts
127.0.0.1 localhost loopback
ip-address fqdn hostname

It will do your need. Just copy this /etc/hosts file setting to all available machines in the network.

Check routing entry for this also If machine is not reachable.
# netstat -rn

hth.
Easy to suggest when don't know about the problem!
Arunvijai_4
Honored Contributor

Re: Revers DNS lookup

Edit your /etc/hosts and add your static IPs there. It should do.

-Arun
"A ship in the harbor is safe, but that is not what ships are built for"
njia_1
Trusted Contributor

Re: Revers DNS lookup

Hi

I had this problem as well, adding hostname to /etc/hosts is not a good solution because the ip address and hostname are keeping changing. New hosts could be added to the network everyday.

Sergejs Svitnevs
Honored Contributor

Re: Revers DNS lookup

From my point of view I can use /etc/hosts file for Forward DNS lookup (hostname->IP)only.
Reverse IP address lookup converts the IP to the name and '/etc/hosts' file does not support this future.
Muthukumar_5
Honored Contributor
Solution

Re: Revers DNS lookup

/etc/hosts will be able to reverse lookup too. (ip-address --> hostname)

--- /etc/hosts ---
127.0.0.1 localhost loopback

# nslookup 127.0.0.1
Using /etc/hosts on: hostname

looking up FILES
Name: localhost
Address: 127.0.0.1
Aliases: loopback

It will return localhost and loopback there on configuring hosts: files there.

It is showing that it is doing R-Lookup too.

hth.
Easy to suggest when don't know about the problem!
Alex Lavrov.
Honored Contributor

Re: Revers DNS lookup

It does.

host->ip and ip->host, works both with /etc/hosts.

Alex.
I don't give a damn for a man that can only spell a word one way. (M. Twain)
Sergejs Svitnevs
Honored Contributor

Re: Revers DNS lookup

Thanks