2

I have a setup where one webserver (bar.com) 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 bar.com as search domain, so that foo resolves to foo.bar.com.

The problem now is that if I set it up like this, foo.com resolves to the webservers IP if there is no foo.com elsewhere (i.e. it first tries foo.com, fails, and then tries foo.com.bar.com, 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).

2 Answers 2

2

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
domain bar.com
0

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .