1

I have a Windows 2003 DNS server that forwards on to OpenDNS. I want to set it up so that when someone requests dev.mydomain.com instead of requesting the IP from OpenDNS it returns a local IP address.

The reason I want to do this is because I have a local dev server called dev locally and dev.mydomain externally. I'd like it if I'm in the office and I type in dev.mydomain, I don't have to go through the internet, because I believe although I'm not sure that that is slower.

Thoughts?

3 Answers 3

2

I found the solution. Instead of creating a forward lookup zone for mydomain.com I created one for dev.mydomain.com and created a blank a record pointing at the IP I wanted.

1
  • 1
    Treating a zone as a host record... clever. Not strictly "correct", but clever :-)
    – Massimo
    Sep 1, 2009 at 14:47
1

If you have a very small network and manage all the machines in it, you can of course add an entry to the HOSTS file in each one of them; but this gets a lot messy if more than 10 computers are involved.

1
  • it gets messy well before that, what if I move on to another company and someone has to try and find out why some names are resolving to odd IPs. At least DNS server is going to be the first place they check.
    – Stephen Lacy
    Sep 1, 2009 at 14:29
0

You can create a "mydomain.com" zone in your DNS server and create a "dev" record in it; but this way your server will become authoritative for that zone and will not forward requests for it to the public DNS, so, in order to make everything else work, you'll need to manually add records for the "real" mydomain.com.

Let's say you have this in your public DNS:

www.mydomain.com - 1.2.3.4
smtp.mydomain.com - 5.6.7.8
dev.mydomain.com - 9.10.11.12

You then need to create a "mydomain.com" zone in your DNS server and populate it this way:

www.mydomain.com - 1.2.3.4
smtp.mydomain.com - 5.6.7.8
dev.mydomain.com - 10.20.30.40 (internal IP address of the server)
2
  • Thanks, that solution works but ideally I wouldn't have to update all the subdomains every time the dns for that domain is updated. I just want to repoint one of them at a different ip.
    – Stephen Lacy
    Sep 1, 2009 at 13:55
  • You can't, there's no way to tell a DNS server "this record is managed by you but all the other records in the same zone are managed by someone else".
    – Massimo
    Sep 1, 2009 at 13:57

You must log in to answer this question.