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 Server 2003 machine serving as a DNS server which I am using to override a number of DNS entries to route them to local IP addresses rather than public addresses. I can create a DNS entry (HOST / A) for www.foo.com, but I have been unable to figure out how to override the DNS entry for foo.com itself.

Here's what I have:

on public DNS servers foo.com and *.foo.com point to 1.2.3.4 1.2.3.4 is a NAT device that is mapping 1.2.3.4 to a machine in the local network 10.1.1.1

I'm trying to create a DNS entry inside of my network so that clients performing a lookup on foo.com that are using the local DNS server will resolve to 10.1.1.1 instead of the public address (because I can't go "out and back" through the NAT device).

I have created a new zone in the DNS management snapin called "foo.com" and added a host entry for "www" with the correct IP address (10.1.1.1). This seems to work correctly. However, when I try to add an entry for "" (no name) everything seems to work in the configuration UI and I get an entry with the name displayed as "(same as parent folder)" but the clients don't resolve this name.

Is there a way to accomplish what I'm trying to do?

share|improve this question
    
You're doing it right. What do you mean "clients don't resolve this name"? They're getting back an NXDOMAIN response, or an incorrect response? –  Evan Anderson Nov 30 '09 at 21:07
    
When I type "nslookup foo.com" I get: Server: UnKnown Address: 10.0.0.2 <-- DNS server name Name: foo.com <!-- No address returned on the other hand "nslookup www.foo.com" gives: Server: UnKnown Address: 10.0.0.2 Name: www.foo.com Address: 10.1.1.1 –  FooTheBar Nov 30 '09 at 22:39

1 Answer 1

I don't know the windows way to do this, but the BIND way to do it is:

[root@dhdx421 internal]# head -n 20 example.com
$ORIGIN .
$TTL 21600      ; 6 hours
example.com              IN SOA  ns3.example.com. hostmaster.example.com. (
                                2009111201 ; serial
                                10800      ; refresh (3 hours)
                                3601       ; retry (1 hour 1 second)
                                259200     ; expire (3 days)
                                21600      ; minimum (6 hours)
                                )
                        NS      ns2.example.com.
                        NS      ns3.example.com.
                        A       172.18.1.100
$ORIGIN example.com.

The A record above is the example.com record. Specifying *.example.com means "anything".example.com, but "anything" can't be null as you've specified a "." and periods have special meaning in DNS.

Additionally, keep in mind that if you're overriding someone else's DNS, unless you setup forwarding properly, you will only be able to resolve the addresses that you've overridden (i.e., made your server authoritative for).

share|improve this answer

Your Answer

 
discard

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