Linux, DNS, and search none

Since when did the resolver on unix attempt to resolve hostnames in the current domain if ‘search’ isn’t set?

It used to be a ‘feature’ where you can specify a search domain (usually the domain where your machine is hosted) so you can connect to the machine with a shorter name. Instead of freedom.example.com you can just connect to ‘freedom’.

Problems start to arise when you’re attempting to access domains which don’t exists. For example if you want to connect to asdfadsfasdfasdfasdf.com this would usually fail to resolve. However if you have search enabled then the DNS will fail and try to connect to asdfadsfasdfasdfasdf.com.example.com. Now imagine if example.com has wildcard DNS!

The hostname which before was broken is now resolving! Fun.

This can be fixed by adding ‘search none’ in your /etc/resolv.conf file.


  1. Thanks! That’s bitten me with our wildcard domain, but I never got around to figuring out why…






%d bloggers like this: