Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question

3 Answers 3

up vote 2 down vote accepted

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.

share|improve this answer
1  
Treating a zone as a host record... clever. Not strictly "correct", but clever :-) –  Massimo Sep 1 '09 at 14:47

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.

share|improve this answer
    
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 '09 at 14:29

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)
share|improve this answer
    
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 '09 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 '09 at 13:57

Your Answer

 
discard

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