[illumos-Developer] DHCP, DNS domains and search lists in /etc/resolv.conf

Gordon Ross gordon.w.ross at gmail.com
Fri Jul 22 06:13:04 PDT 2011


On Tue, May 17, 2011 at 5:11 PM, Andrew Gabriel
<illumos at cucumber.demon.co.uk> wrote:
> Hans Rosenfeld wrote:
>>
>> Hi,
>>
>> I got a problem with DHCP-supplied DNS domain names and NWAM.
>>
>> The dhcp server at work gives me three domain names: foo.bar.com,
>> bar.com and baz.com. On OpenSolaris b134 that resulted in a single
>> "domain foo.bar.com" statement in /etc/resolv.conf.
>> Since I upgraded to OI, which includes the new NWAM stuff that was
>> integrated into ONNV about a year ago, that results in three domain
>> statements in /etc/resolv.conf:
>>
>> domain foo.bar.com
>> domain bar.com
>> domain baz.com
>> nameserver ...
>>
>> Resolv.conf(4) states that only one domain or search statement is
>> allowed, and that the last one found is used if there are more than one.
>> So I now get a DNS domain and search list of "baz.com", and the
>> other domains are ignored.
>>
>> I just hacked together a quick fix which should give some saner
>> behaviour. If only one DNS domain name is provided, a domain statement
>> will be created in /etc/resolv.conf, otherwise a search statement with
>> all domains will be used.
>>
>
> With current resolver versions, I don't think there's any difference
> between a domain statement, and a search statement with just one
> entry, so you can probably simply always use search regardless of
> the number of entries.
>
> --
> Andrew

While it may be true that resolv.conf domain and search lines are equivalent,
other consumers of this information (i.e. CIFS) might care to know what was
actually given as the domain by the DHCP server.

How hard is it to write the first name as domain, and additional names
in search?

Gordon



More information about the Developer mailing list