Results 1 to 4 of 4

Thread: What are these entries in /etc/resolv.conf

  1. #1
    Join Date
    Oct 2009
    Beans
    262

    What are these entries in /etc/resolv.conf

    My /etc/resolv.conf shows:

    # Generated by NetworkManager
    domain someuniversity.ac.uk
    search someuniversity.ac.uk
    nameserver 128.85.161.265
    nameserver 128.85.161.241

    I understand nameserver but what is the usefulness and relevance of "domain" and "search"?

    Thanks .

  2. #2
    Join Date
    Sep 2010
    Location
    Indian Capital City
    Beans
    916
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: What are these entries in /etc/resolv.conf

    Code:
    man resolv.conf
    When you have eliminated the impossible, whatever remains, however improbable, must be the truth !!
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Mark it [SOLVED] if the issue has been resolved

  3. #3
    Join Date
    Oct 2009
    Beans
    262

    Re: What are these entries in /etc/resolv.conf

    Point taken - thanks.

    So:

    domain Local domain name.
    Most queries for names within this domain can use short names
    relative to the local domain. If no domain entry is present,
    the domain is determined from the local hostname returned by
    gethostname(2); the domain part is taken to be everything after
    the first '.'. Finally, if the hostname does not contain a
    domain part, the root domain is assumed.

    Therefore the "domain" is just used for searching for ftp or http or whatever sites on that specific domain.

    and:

    search Search list for host-name lookup.
    The search list is normally determined from the local domain
    name; by default, it contains only the local domain name.

    I'm not so sure what this means. What is the search list - derived from the local domain name - for; for what does it search?

    Let's say my /etc/resolv.conf file shows: search name1.name2.somewhere.co.uk then what would the search list search for?

    Thanks.

  4. #4
    Join Date
    Nov 2008
    Location
    Boston MetroWest
    Beans
    16,326

    Re: What are these entries in /etc/resolv.conf

    The "search" directive provides a set of additional domain extensions that the resolver uses when dealing with "unqualified" host names. So if you enter "billspc" it will first try billspc with the domain entry attached, then try it with each extension in the search list until the name resolves. Having both the "domain" and "search" parameters identical seems pretty common these days, though I don't think the "search" entry is needed in that case. It only matters if you want to resolve unqualified names across a number of pre-specified domains other than the one appearing in the "domain" directive.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •