Databases
cancel
Showing results for 
Search instead for 
Did you mean: 

SQL Plus and name resolution

samd_1
Super Advisor

SQL Plus and name resolution

I had an issue recently with connecting to Oracle after our Internet connection went down. Even though we host our own DNS the lack of an Internet connection caused very slow telnet connection times, SQL Plus connection times, and queries in the application. It seems that the timeout was way too long for DNS so I actually moved hosts first and just renamed my resolv.conf. After doing this all issues were solved except for the slowness in connecting to Oracle. The only thing I can think of is it's happening because we use WINS in combination with DNS and that's how clients are looked up. Still not sure why teh Internet connection being down causes this. So how do I prevent this slowness for the next time our Internet connection goes down. I can't put every hostanme and IP address in the HPUX hosts file since we run a DHCP environment. Currently I have to add clients to this manually for Telnet and X to work for clients. Thanks
4 REPLIES
G.Kumar
Frequent Advisor

Re: SQL Plus and name resolution

what is your entry for dns in /etc/nsswitch.conf.you have to mention files in search order if dns not resolves the name.

GK
samd_1
Super Advisor

Re: SQL Plus and name resolution

Here is the contents of nsswitch.conf

hosts: files[NOTFOUND=continue UNAVAIL=continue] dns [NOTFOUND=return UNAVAIL=return TRYAGAIN=return] nis
Sachin Patel
Honored Contributor

Re: SQL Plus and name resolution

Hi Sam,
Where is your DNS server? in your subnet?

Generally timeout on first nameserver which is listed on resolv.conf is only 90 sec. then it goes to second nameserver if any present then it goes to forwarder if any present. or else gives the error.
So at maximum it will takes 90x3Sec for nameservers before timeout.

Sachin
Is photography a hobby or another way to spend $
Bill Hassell
Honored Contributor

Re: SQL Plus and name resolution

As you have discovered, DNS is crucial to the success of any client/server system. /etc/hosts must always be first in nsswitch.conf, both for reliability as well as speed. And until your DNS is reliable, you'll have to populate it with all the client addresses.

But that's not too difficult. You can generate address ranges using a script where the hostname is a simple name formed out of the last couple of octets of the IP as in:

12.34.56.78 dhcp5678
12.34.56.79 dhcp5679

and so on. /etc/hosts handles reverse lookup and unless there is some very strange code going on, the clients aren't going to use their own name in communicating with the server.

The DNS timeout is VERY long (10's of seconds) and this is *only* when the DNS server is dead, not when the server cannot locate an address. Your nsswitch.conf statement handles that. However, the first entry in /etc/resolv.conf had better be running 24x7 for all addresses/hostnames that are not found in /etc/hosts.


Bill Hassell, sysadmin