LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 11-13-2006, 06:09 AM   #1
bl243
LQ Newbie
 
Registered: Nov 2006
Posts: 3

Rep: Reputation: 0
resolv.conf order (Red Hat EL3)


Hi all,

Looking at the resolv.conf manual, it suggests nameserver entries in the resolv.conf file are tried in turn until a response is received.

I have three DNS servers on my network all are listed in the resolv.conf file.

I took one of the DNS servers down the other day. It was the third entry in my Linux machines resolv.conf file. However, DNS resolution became very slow until I brought the DNS back up again.

Has the behaviour of resolv.conf changed and the manual not been updated? Can anyone think why this might have happened?

Thanks,
Ben
 
Old 11-13-2006, 10:28 AM   #2
b0uncer
LQ Guru
 
Registered: Aug 2003
Distribution: CentOS, OS X
Posts: 5,131

Rep: Reputation: Disabled
I thought (as you did probably too) that the list is read from top till bottom, one by one, but now that I think of it, it's not impossible that the list is read from bottom till top. Did you try taking the other servers out one by one, or could you possibly use a network sniffer to find out where it first tries to send the queries?
 
Old 11-13-2006, 10:42 AM   #3
bl243
LQ Newbie
 
Registered: Nov 2006
Posts: 3

Original Poster
Rep: Reputation: 0
b0uncer

Now that i've fixed the issue, I can't recreate it. It certainly is working as expected now. A tcpdump shows a query to the first entry in the list (from top downwards) and it doesn't try the second unless the first fails.

I put a bogus address as the 3rd entry to simulate one of the DNS servers being down, but it doesn't suffer the performance issue I saw this morning.

To avoid any caching issues, i will leave the machine overnight and try again tomorrow.

Ill post the results.

Cheers,
Ben
 
Old 11-14-2006, 03:27 AM   #4
bl243
LQ Newbie
 
Registered: Nov 2006
Posts: 3

Original Poster
Rep: Reputation: 0
Ok - ive found out what is going on.

Only SSH sessions were affected.

The machines I was having problems on are Red Hat EL3 with OpenSSH 3.6. The problem wasn't seen on Red Hat EL4 with OpenSSH 3.9.

What happens is that in earlier versions of OpenSSH - by default the SSH client tries to connect via ipv6 before it falls back to ipv4.

In our case it tries to resolve the hostname via ipv6, which fails. It then tries each DNS in turn, including the one that is down (causing the hangs) - when it fails on all servers it drops to ipv4 and then works.

Appending a -4 on the ssh command gets around the problem. But most of our users won't remember or want to do this.

Unfortunately the command "AddressFamily inet" which can be used in the ssh_config file to force ipv4 connectivity, does not work with OpenSSH 3.6. If I upgrade to a newer version I break the Enterprise model for RedHat and will no longer get auto updates for it.

I don't want to put an alias for each user adding the -4 as this is nasty and will get forgotten.

I guess Ill just leave it as it is - it only happens when a DNS is out of action and it doesn't actually stop ssh sessions, just slows the initial connection.

Hope this was of some use to someone!

Cheers,
Ben
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
DNS Hosts.conf or resolv.conf problem mac_casey SUSE / openSUSE 0 03-26-2006 09:21 AM
Red Hat EL3 X GUI crashed yechenglin Red Hat 2 01-29-2006 11:02 AM
Can you change the order in which services start in Red Hat 9? BurceB7 Linux - General 1 04-29-2004 07:09 AM
resolv.conf ricemark20 Linux - Networking 12 11-11-2003 04:08 PM
Modifying Red Hat 7.3 Grub conf. file nixdisciple Linux - General 4 06-02-2002 10:37 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 12:16 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration