Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have a web server on my local network with a couple domains facing the internet. When I visit these domains from within the network I'm directed to my routers configuration page due to hairpin NAT.

So I installed BIND9 on the server and set up my forwarders to Google DNS to act as a Caching Nameserver. Then I set my routers DNS primary and secondary nameservers to the IP of the local BIND server. Everything is working great.

Now I need help configuring BIND so that the domains hosted on the web server within the network are routed to the web server and not the routers configuration page.

share|improve this question
    
The question, as you have asked it, is somewhat unanswerable, or at least without rewriting existing documentation. Can you give us an indication about where you are in your BIND configuration? –  Kirk Jun 10 '11 at 20:04
    
I have only configured my forwarders in the named.conf.options file. I now want to set up routing for a domain on the web server, say example.net so that it will route to the web server when you are on the network. –  Chad Whitaker Jun 10 '11 at 20:08
    
This is a very large topic that is not easy to answer without significant additional information. I'd recommend googling for a tutorial, and post back to Super User when you get stuck and are able to provide more specifics. –  Kirk Jun 10 '11 at 21:09
    
It's actually a very simple question asked poorly. Xe is asking how to provide split horizon DNS service with BIND so that within the network the name of the WWW server resolves to an internal IP address rather than to the external IP address that the rest of Internet sees. If the questioner had picked the right StackExchange site, xe would have seen this question answered over and over again on ServerFault. –  JdeBP Jun 10 '11 at 22:40
add comment

closed as not a real question by studiohack Jun 10 '11 at 23:57

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

1 Answer

up vote 0 down vote accepted

I assume your BIND nameserver is only accessible by systems inside the network.

What you need to do is create zones in your named.conf for your domains which list the internal IP addresses of your web server(s) instead of the public IP address. The zone entry in your named.conf will look something like this:

zone "example.com" {
        type master;
        file "/var/lib/bind/pri/db.example.com"; //edit as necessary
        allow-query { 192.168.1.0/24; }; //edit to match your internal network
        allow-transfer { localhost; };
        allow-update { none; };
};

Then you need to create the zone file in /var/lib/bind/pri/db.example.com (or wherever the zone file is stored) which will look something like this:

$TTL    3600
@       IN      SOA     example.com. adminmailaddr.example.com. (
                     2011061000         ; Serial
                         604800         ; Refresh
                          86400         ; Retry
                        2419200         ; Expire
                         604800 )       ; Negative Cache TTL
;
@       IN      NS      hostname.of.BIND.server.   ;fully-qualified address with trailing dot
@       IN      A       192.168.1.178    ; change this IP address as needed
www     IN      A       192.168.1.178    ; change this IP address as needed
share|improve this answer
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.