Resolve Subdomains to Full Domains

1

I'm trying to work out how I could configure my machine (presumably my machine's DNS settings) to resolve subdomains to the appropriate full domain of my site, mostly for shorthand purposes in development. For example, I would like 'www' to resolve to 'www.mysite.com', 'blah' to 'blah.mysite.com' and so on.

I don't really know where to start other than that I'm pretty sure this is outside the remit of simple /etc/hosts shenanigans. Will I need to run a local DNS server?

unwitting

Posted 2014-11-05T20:16:55.593

Reputation: 113

Question was closed 2014-11-06T08:24:33.133

Which OS are you using? – Ƭᴇcʜιᴇ007 – 2014-11-05T20:21:50.287

Answers

2

Just add mysite.com to the search domains. In your resolv.conf (assuming you are using *NIX), add the following

search mysite.com local.lan
nameserver <ip>
nameserver <ip>

dors

Posted 2014-11-05T20:16:55.593

Reputation: 199

Thanks a lot, that's exactly what I was looking for :) DNS config noob... – unwitting – 2014-11-06T08:43:49.563