Skip to content
Advertisement

The domain and search options in resolv.conf

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?

Advertisement

Answer

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.

Advertisement