dhcpcd-discuss

Re: domain versus search keywords in resolvconf

Roy Marples

Tue Mar 10 09:25:56 2015

Hi Joachim

On 09/03/2015 21:43, Joachim Achtzehnter wrote:
> Not sure if this is primarily an issue with dhcpcd or openresolv, or both.

openresolv

> According to the "resolv.conf" man page, for example here:
> 
>   http://linux.die.net/man/5/resolv.conf
> 
>   The domain and search keywords are mutually exclusive.
>   If more than one instance of these keywords is present,
>   the last instance wins.
> 
> When dhcpcd is configured with:
> 
>   option domain_name, domain_search
> 
> I.e., specifying both in order to handle all kinds of DHCP servers, not
> knowing which of the two options the server can provide, dhcpcd
> generates a "resolv.conf" file that contains both keywords.

There is an issue with this:

$ cat /etc/resolvconf.conf
resolv_conf=/tmp/res

$ cat /etc/resolv.conf

$ echo "domain foo" | sudo resolvconf -a foo
$ echo "search bar" | sudo resolvconf -a bar
$ printf "domain dead\nsearch beef\n" | sudo resolvconf -a dead.beef
$ resolvconf -l
# resolv.conf from bar
search bar

# resolv.conf from dead.beef
domain dead
search beef

# resolv.conf from foo
domain foo

Everything is fine up to here:

$ cat /tmp/res
# Generated by resolvconf
domain dead
search bar beef foo

As we can see, dead is not in the search list.
This will be fixed. The correct output is this:

$ cat /tmp/res
# Generated by resolvconf
domain dead
search bar dead beef foo

> The openresolv scripts fail to normalize these mutually exclusive
> keywords, generating a combined file that still contains both.

This is not an error.
openresolv will list a domain if requested.
Software exists that will use the domain listed in resolv.conf for
things other than DNS but place it before search as search will take
precedence for DNS.

Roy

Follow-Ups:
Re: domain versus search keywords in resolvconfRoy Marples
References:
Multihoming support in dhcpcd (source-dest routing)Baptiste Jonglez
Re: Multihoming support in dhcpcd (source-dest routing)Roy Marples
Re: Multihoming support in dhcpcd (source-dest routing)Baptiste Jonglez
Re: Multihoming support in dhcpcd (source-dest routing)Roy Marples
domain versus search keywords in resolvconfJoachim Achtzehnter
Archive administrator: postmaster@marples.name