About Linux FAQ

Browse More FAQs:

Configure Linux / UNIX dns resolver to append domain search names / path ( ndots options )

Posted by Vivek Gite [Last updated: June 6, 2007]

Q. I’m using CentOS 5.0 server. How do I configure a system so that the DNS resolver will append search path extensions to hostnames that have dots in them? For example my domain name is test.com. When I quary for mail hostname it should append .test.com and return the IP address of mail.test.com

A.. You can easily configure The domain search list. The search list is normally determined from the local domain name; by default, it contains only the local domain name. This may be changed by listing the desired domain search path following the search keyword with spaces or tabs separating the names. Resolver queries having fewer than ndots dots (default is 1) in them will be attempted using each component of the search path in turn until a match is found. For environments with multiple subdomains please read options ndots:n below to avoid man-in-the-middle attacks and unnecessary traffic for the root-dns-servers. Note that this process may be slow and will generate a lot of network traffic if the servers for the listed domains are not local, and that queries will time out if no server is available for one of the domains.

Task: SETUP DNS SEARCH LIST FOR HOST-NAME LOOKUP

Open /etc/resolv.conf file
# vi /etc/resolv.conf
OR
$ sudo vi /etc/resolv.conf
Now add search path:
search test.com
Save and close the file.

Optional ntdots configuration

Note you may also need to use ndots:n option to sets a threshold for the number of dots which must appear in a name given to query before an initial absolute query will be made. The default for n is "1", meaning that if there are any dots in a name, the name will be tried first as an absolute name before any search list elements are appended to it. For example set ndots to 2 as follows, to answer nslookup f1.mail query to get IP for f1.mail.in.test.com host:
options ndots:2
search test.com in.test.com

Limitations

  • The search list is currently limited to six domains with a total of 256 characters.

Subscribe to our free e-mail newsletter or RSS feed to get all updates. You can Email this page to a friend.

Related Other Helpful FAQs:

Discussion on This FAQ

  1. vinod Says:

    What all the Daily Activities need to be done on a freebsd server,

Leave a Reply

We encourage your comments, and suggestions. But please stay on topic, be polite, and avoid spam. Thank you very much for stopping by our site!

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word

Copyright © 2006-2008 nixCraft. All rights reserved - TOS/Disclaimer - Privacy policy - Sitemap - Powered by Open source software.