-1

I can't get my BIND9 server to work for internal name resolution. My clients always get an external IP back. I guess the internal fails and I get redirected out and someone has homenet.com

for example ping yoda does not return 10.0.1.7, but a 75.10 address.

My firewall hands out DHCP, so my clients all have forwarders already, so my internet works.

How can I get my DNS to resolve internally? I have tried a bunch of tutorials, and seen a ton of questions here.

My /etc/bind/named.conf.local

//
// Do any local configuration here
//

// Consider adding the 1918 zones here, if they are not used in your
// organization
//include "/etc/bind/zones.rfc1918";
zone "homenet.com" {
        type master;
        file "/etc/bind/homenet.com.zone";
};

zone "1.0.10.in-addr.arpa" {
        type master;
        file "/etc/bind/homenet.com.rev";
};

My /etc/bind/named.conf.options

options {
        recursion yes;
        allow-query {localhost; 10.0.1.0/24; };
        allow-recursion { 10.0.1.0/24; };
        listen-on { 10.0.1.20; };
        dnssec-validation auto;
        //forwarders {
        //8.8.8.8;
        //8.8.4.4;
        //};
        listen-on-v6 { none; };
};

My zone homenet.com.zone

;
; BIND data file for local loopback interface
;

$TTL    604800
@       IN      SOA     homenet.com. root.homenet.com. (
                              9         ; Serial
                         604800         ; Refresh
                          86400         ; Retry
                        2419200         ; Expire
                         604800 )       ; Negative Cache TTL
;
        IN      NS      jiraserver.homenet.com

; name servers - A records
jiraserver      IN      A       10.0.1.20

; 10.0.1.0/24 - A records
moonbase        IN      A       10.0.1.2
nas             IN      A       10.0.1.6
yoda            IN      A       10.0.1.7
solo            IN      A       10.0.1.22

My reverse lookup file /etc/bind/homenet.com.rev

;
; BIND reverse data file for local loopback interface
;
$TTL    604800
@       IN      SOA     jiraserver.homenet.com. root.homenet.com. (
                              6         ; Serial
                         604800         ; Refresh
                          86400         ; Retry
                        2419200         ; Expire
                         604800 )       ; Negative Cache TTL
;
@       IN      NS      jiraserver.
20      IN      PTR     jiraserver.homenet.com.

; PTR Records
2       IN      PTR     moonbase        ;10.0.1.2
6       IN      PTR     nas             ;10.0.1.6
7       IN      PTR     yoda            ;10.0.1.7
22      IN      PTR     solo            ;10.0.1.22
Siriss
  • 209
  • 1
  • 3
  • 13

1 Answers1

0

A number of things:

  • use your own domain (buying one is cheap!)
  • or obfuscate to example.com
  • use fully qualified domain names when testing DNS i.e. "yoda.homenet.com." and not "yoda" and only after your DNS is working correctly try to resolve issues with how search domains get appended (or not)

  • check the syntax of your configuration file with named-checkconf and your zonefiles with named-checkzone and you log files.

  • you need to test against the ip-address of your own nameserver (unless you registered your domain and that Bind server is already your officially published nameserver) i.e.:

    dig -t A yoda.homenet.com. @ip.of.nameserver  
    
  • Bind has a few oddities with regards to shorthand notations and how and when it converts short names (entries that don't end in a dot .) to fully qualified domain names, please be careful and consistent in your zone file syntax.
    Bind will convert a section such as this which is mixing shorthand and short hostnames and incorrect FQDN's :

    ;                                         
        IN      NS      jiraserver.homenet.com
    ; ^ Here the line starts with a space     ^ - Here a trailing . is missing 
    
    ; name servers - A records
    jiraserver      IN      A       10.0.1.20
    

    to

    ;                                         
    homenet.com.    IN      NS      jiraserver.homenet.com.homenet.com. 
    
    ; name servers - A records
    jiraserver.homenet.com.      IN      A       10.0.1.20
    

    and

    7       IN      PTR     yoda            ;10.0.1.7
    

    to

    7.1.0.10.in-addr.arpa.       IN      PTR     yoda.1.0.10.in-addr.arpa.            ;10.0.1.7
    
HBruijn
  • 77,029
  • 24
  • 135
  • 201