LinuxQuestions.org
Review your favorite Linux distribution.
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 05-28-2008, 07:37 PM   #1
grizly
Member
 
Registered: Nov 2006
Location: Melbourne Australia
Distribution: Centos, RHEL, Debian, Ubuntu, Mint
Posts: 128

Rep: Reputation: 16
/etc/resolv.conf question. Max Search Entries.


Hi All,

I was wondering how many search entries you can add to /etc/resolv.conf

for instance.

search domain.com
search domain.com.au
search localdomain.local
nameserver IP.ADD.RE.SS
nameserver IP.ADD.RE.SS

It appears that which is last on the list works fine, For instance,

ping server.localdomain.local = Success
ping server.domain.com.au = fail
ping server.domain.com = fail

change the order, so .local is on top!

ping server.localdomain.local = fail
ping server.domain.com.au = fail
ping server.domain.com = Success

wtf?

Anybody know what the limit is? Does the order matter?


Just in case:
nameserver 1 = domain.com & domain.com.au
nameserver 2 = localdomain.local

Server2 forwards requests to Server1, Server1 forwards to ISP DNS.


Reading the man page for resolv.conf, it tells me to check the header for resolv.. lucky me, I have it!

Quote:
/*
* Global defines and variables for resolver stub.
*/
# define MAXNS 3 /* max # name servers we'll track */
# define MAXDFLSRCH 3 /* # default domain levels to try */
# define MAXDNSRCH 6 /* max # domains in search path */
# define LOCALDOMAINPARTS 2 /* min levels in name that is "local" */
Which answers part of my question.. 6 in the search list..
But in practice, that doesn't seem to be the case.

It doesn't like you having more than one..

To test it, I added the directive:

options no-check-names to /etc/resolv.conf

(as one of our domains contains an underscore)

But it hasn't made any difference. I thought maybe because the second DNS server is authoritative for the first names, that it would need to be first, so I reversed them.. nothing.

I even added secondary copies of each domain to the DNS servers, so each is a backup for the other. Then tried adding "options rotate", nothing.

I looked into it online, and it appears to be an inherent limitation of glibc, which they have no intention of fixing... so, should I just put BIND on the box?

Any ideas ?
 
Old 05-28-2008, 07:43 PM   #2
grizly
Member
 
Registered: Nov 2006
Location: Melbourne Australia
Distribution: Centos, RHEL, Debian, Ubuntu, Mint
Posts: 128

Original Poster
Rep: Reputation: 16
lmfao.. figured it out, you have to put the search directives on one line!

search localdomain.local domain.com.au domain.com
nameserver XXX
nameserver XXX


Works a charm! Phew!
 
  


Reply

Tags
dns, resolvconf


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
multiple DNS entries to /etc/resolv.conf noir911 Linux - Networking 1 02-26-2007 11:43 PM
resolv.conf deletes nameserver entries Mirkridian Linux - Wireless Networking 1 02-19-2007 01:59 AM
resolv.conf DNS search ( Anyway to continue searching next entry?) starsky Linux - Networking 5 08-22-2006 09:01 PM
entries in the /etc/resolv.conf ! prabhatsoni Linux - Networking 4 01-28-2006 04:52 AM
resolv.conf search line dunkyb Linux - Networking 4 01-28-2005 01:50 AM


All times are GMT -5. The time now is 10:20 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration