LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (http://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Issue with Bind resolution (http://www.linuxquestions.org/questions/linux-networking-3/issue-with-bind-resolution-931926/)

druisgod 02-29-2012 07:33 AM

Issue with Bind resolution
 
Hi. I have a server that I am running bind with two seperate zones on. I am using apache to serve up a website and would like the users to be able to go to "hostname.network.lan/websitename" and the .lan part isn't getting resolved. In other words, I can browse to hostname.network/websitename just fine, but hostname.network.lan/websitename give a "server not found" error.

Here is the internal zone file:
Code:

$TTL 86400
@  IN  SOA    linserv2.internal.lan. root.internal.lan.(
        2011071002  ;Serial
        3600        ;Refresh
        1800        ;Retry
        604800      ;Expire
        86400      ;Minimum TTL
)


        IN  NS      linserv2.internal.lan.
        IN  MX 10  linserv2.internal.lan.


linserv2    IN  A      172.31.100.254
bob            IN        A        172.31.100.5

and the named.conf file:

Code:

options {

#listen-on port 53 { 127.0.0.1; };

listen-on-v6 { none; };

directory "/var/named";

dump-file "/var/named/data/cache_dump.db";

statistics-file "/var/named/data/named_stats.txt";

memstatistics-file "/var/named/data/named_mem_stats.txt";

allow-query { localhost;172.31.100.0/24;};

recursion yes;

};

logging {
        channel default_debug {
                file "data/named.run";
                severity dynamic;
        };
};


view "internal" {
        match-clients {
                localhost;
                172.31.100.0/24;
        };
        zone "." IN {
                type hint;
                file "named.ca";
        };
        zone "internal" IN {
                type master;
                file "internal.lan";
                allow-update { none; };
        };
        zone "0.31.172.in-addr.arpa" IN {
                type master;
                file "0.31.172.db";
                allow-update { none; };
        };
include "/etc/named.rfc1912.zones";
};
view "external" {
        match-clients { any; };
        allow-query { any; };
        recursion no;
        zone "external" IN {
                type master;
                file "external.wan";
                allow-update { none; };
        };
        zone "0.168.192.in-addr.arpa" IN {
                type master;
                file "0.168.192.db";
                allow-update { none; };
        };
};

My resolv.conf:

Code:

# No nameservers found; try putting DNS servers into your
# ifcfg files in /etc/sysconfig/network-scripts like so:
#
# DNS1=xxx.xxx.xxx.xxx
# DNS2=xxx.xxx.xxx.xxx
# DOMAIN=lab.foo.com bar.foo.com
search internal.lan
nameserver        172.31.100.254


MensaWater 02-29-2012 07:40 AM

Your zone names are wrong in named.conf. You have "internal" but it should be "internal.lan", "external" but it should be "external.wan". You have specified those as file names but it is the zone name not the file name that determines what is being served by BIND. (That is to say you could name your file billybob so long as the zone name was internal.lan and it would work, assuming you had the file billybob.)

druisgod 02-29-2012 07:47 AM

Quote:

Originally Posted by MensaWater (Post 4615018)
Your zone names are wrong in named.conf. You have "internal" but it should be "internal.lan", "external" but it should be "external.wan". You have specified those as file names but it is the zone name not the file name that determines what is being served by BIND. (That is to say you could name your file billybob so long as the zone name was internal.lan and it would work, assuming you had the file billybob.)

DOH! I didn't even see that! I thought the zone names in named.conf were arbitrary and used for organizational purposes and that the zone file's A records actually declared the name to be resolved. Thanks for the help!!!


All times are GMT -5. The time now is 12:31 PM.