LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   /etc/resolv.conf question. Max Search Entries. (https://www.linuxquestions.org/questions/linux-networking-3/etc-resolv-conf-question-max-search-entries-645457/)

grizly 05-28-2008 07:37 PM

/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 ?

grizly 05-28-2008 07:43 PM

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!


All times are GMT -5. The time now is 08:56 PM.