Let's say you have a resolv.conf file that's something like this.
nameserver 192.168.0.7
nameserver 192.168.0.8
domain somedomain.local
Then let's say you just changed it to this.
nameserver 192.168.0.7
nameserver 192.168.0.8
search somedomain.local
Would these both do the same thing? Is one slightly better than the other?
Why would declaring both a domain and search not be recommended?
The existence of both keywords are probably historically. Only one of them can be specified in the resolv.conf (the parser built into glibc is supposed to use the last one it encounters). The search keyword is slighty more powerful, since it allows multiple entries, and has the ndots option.
man 5 resolv.conf
currently reads:
The domain directive is an obsolete name for the search directive that handles one search list entry only.
Stian Skjelstad summarized the benefits of using search
over domain
nicely.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With