3

When connecting to the Internet by default I get two lines in my /etc/resolv.conf file:

I'd like to know what exactly "search localdomain" means there.
I see that it's probably related to DNS but I'm not sure how and couldn't find sufficient information on that. I also don't understand why it's getting removed when I disconnect from the Internet - shouldn't it stay there?
I'm using Debian 9.1 with KDE.

1 Answer 1

5

man resolv.conf:

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. 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. (...)

localdomain here is your domain. When you make a DNS query with no dot (actually with fewer dots than the configuration value ndots), this domain is automatically added to your query. I.E. if you look up for foo, the actual DNS lookup will be for foo.localdomain.

4
  • The questioner also wanted to know why it was appearing and disappearing in that file.
    – JdeBP
    Commented Aug 18, 2017 at 15:51
  • @JdeBP Yes, in question 386790
    – xhienne
    Commented Aug 18, 2017 at 16:20
  • Am I generating such DNS lookups when I enter search terms without a dot in Firefox ESR's address bar (for websearch and not for accessing local resources)? And do these DNS lookups in practice exit my LAN (wouldn't make sense as localdomain is local)?
    – mYnDstrEAm
    Commented Aug 18, 2017 at 18:00
  • 1
    @mYnDstrEAm 1. If your URL is http://single_word/, yes. Else, it really depends on the inner working of FF, it may try a lookup before a websearch. 2. Probably, AFAIK localdomain has nothing special. It depends of the DNS proxy embedded in your router and whether its domain has been set to localdomain too.
    – xhienne
    Commented Aug 19, 2017 at 8:21

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .