What is domain and search in /etc/resolv.conf

Posted on 2009-04-18
Last Modified: 2012-05-06
I see something like below, can someone explain me what is 'domain' and 'search' and how it affects the domain name resolution. Thanks!
bash-3.2$ cat /etc/resolv.conf 





Open in new window

Question by:beer9
    LVL 40

    Assisted Solution

    when users are not typing FQDN then the search domains will be tried along with the domains names in search clause

    from man page:

    "The domain and search keywords are mutually exclusive. If more than one instance of these keywords is present, the last instance takes precedence."
    LVL 48

    Accepted Solution

    As an example, say you have


    then when you do a lookup with a fully qualified domain name, eg:

    nslookup server

    The search line tells that it should first lookup

    and if nothing is found, search
    LVL 16

    Assisted Solution

    by:Hanno Schröder
    "search" and "domain" is basically the same. You should only use one or the other.
    If you have both in your file, the last entry takes precedence.
    If you have no "domain" (or "search") entry, the system will determine your domain
    from you systems's name: Everything following the first dot will be considered your
    domain name. If there is no dot, the root domain "." will be assumed.

    Author Closing Comment

    Thank you :-)

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    What Security Threats Are You Missing?

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    My previous tech tip, Installing the Solaris OS From the Flash Archive On a Tape (, discussed installing the Solaris Operating S…
    Every server (virtual or physical) needs a console: and the console can be provided through hardware directly connected, software for remote connections, local connections, through a KVM, etc. This document explains the different types of consol…
    Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
    Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    10 Experts available now in Live!

    Get 1:1 Help Now