Sign up ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I have a setup where one webserver ( is serving lots of subdomains, so it would be convenient to use a wildcard DNS entry. At the same time I'd like to use as search domain, so that foo resolves to

The problem now is that if I set it up like this, resolves to the webservers IP if there is no elsewhere (i.e. it first tries, fails, and then tries, which gets matched by the wildcard).

This is very inconvenient because any hostname typos ends up at the webserver instead of producing an error. Is there a way to resolve this without specifying all the subdomains explicitly? I'm thinking something like a rule saying only "bare" hostnames (i.e. names without a dot in it) should go to the webserver. (I'm using BIND as DNS server, but the answer is probably general).

share|improve this question

2 Answers 2

up vote 2 down vote accepted

You shouldn't mix a wildcard domain, and a search domain in the same resolv.conf. If you want to try, switch search for domain;

# /etc/resolv.conf
nameserver x.y.z.k
share|improve this answer

Unfortunately for you, this is a feature of a client, not server.

see man resolv.conf i.e. for unices, windows probably has different rules

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.