2

I'm new to DNS and making a DNS server. I've read through the bind9 server how to (at https://help.ubuntu.com/community/BIND9ServerHowto) and several tutorials online on setting up a bind9 server in ubuntu. I haven't gotten any of them to work yet.

I'm trying to get fivestones.desonia to resolve to my computers LAN ip address of 192.168.1.139.

My named.conf.options file:

options {
    directory "/var/cache/bind";

    // If there is a firewall between you and nameservers you want
    // to talk to, you may need to fix the firewall to allow multiple
    // ports to talk.  See http://www.kb.cert.org/vuls/id/800113

    // If your ISP provided one or more IP addresses for stable
    // nameservers, you probably want to use them as forwarders.
    // Uncomment the following block, and insert the addresses replacing
    // the all-0's placeholder.

    forwarders {
            8.8.8.8;
            8.8.4.4;
    };

    //========================================================================
    // If BIND logs error messages about the root key being expired,
    // you will need to update your keys.  See https://www.isc.org/bind-keys
    //========================================================================
    dnssec-validation auto;

    auth-nxdomain no;    # conform to RFC1035
    listen-on-v6 { any; };
};

My named.conf.local file:

#//
#// 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 "fivestones.desonia" {
  type master;
  file "/etc/bind/zones/db.fivestones.desonia";
};

zone "1.168.192.in-addr.arpa" {
    type master;
    notify no;
    file "/etc/bind/zones/db.192";
};

my /etc/bind/zones/db.192 file:

;
; BIND reverse data file for local loopback interface
;
$TTL    604800
@       IN      SOA     ns.fivestones.desonia. root.fivestones.desonia. (
                 2013012113         ; Serial
                     604800         ; Refresh
                      86400         ; Retry
                    2419200         ; Expire
                     604800 )       ; Negative Cache TTL
;
@       IN      NS      ns.
10      IN      PTR     ns.fivestones.desonia.

my /etc/bind/zones/db.fivestones.desonia file

;
; BIND data file for local loopback interface
;
$TTL    604800
@       IN      SOA     ns.fivestones.desonia. root.fivestones.desonia. (
                 2013012110         ; Serial
                     604800         ; Refresh
                      86400         ; Retry
                    2419200         ; Expire
                     604800 )       ; Negative Cache TTL
;
@       IN      NS      ns.fivestones.desonia.
ns      IN      A       192.168.1.139
server  IN      A       192.168.1.139
www     IN      A       192.168.1.139

I sudo service bind9 restart and then this is my tail -f /var/log/syslog:

Jan 21 23:47:25 media-server named[16726]: command channel listening on 127.0.0.1#953
Jan 21 23:47:25 media-server named[16726]: command channel listening on ::1#953
Jan 21 23:47:25 media-server named[16726]: zone 0.in-addr.arpa/IN: loaded serial 1
Jan 21 23:47:25 media-server named[16726]: zone 127.in-addr.arpa/IN: loaded serial 1
Jan 21 23:47:25 media-server named[16726]: zone 1.168.192.in-addr.arpa/IN: loaded serial 2013012113
Jan 21 23:47:25 media-server named[16726]: zone 255.in-addr.arpa/IN: loaded serial 1
Jan 21 23:47:25 media-server named[16726]: zone fivestones.desonia/IN: loaded serial 2013012110
Jan 21 23:47:25 media-server named[16726]: zone localhost/IN: loaded serial 2
Jan 21 23:47:25 media-server named[16726]: managed-keys-zone ./IN: loaded serial 2
Jan 21 23:47:25 media-server named[16726]: running

But when I try to host -l fivestones.desonia I get

; Transfer failed.
Host fivestones.desonia not found: 9(NOTAUTH)
; Transfer failed.

And if I try to ping fivestones.desonia I get ping: unknown host fivestones.desonia. If I host google.com I get

google.com has address 74.125.227.96
google.com has address 74.125.227.97
google.com has address 74.125.227.98
google.com has address 74.125.227.99
google.com has address 74.125.227.100
google.com has address 74.125.227.101
google.com has address 74.125.227.102
google.com has address 74.125.227.103
google.com has address 74.125.227.104
google.com has address 74.125.227.105
google.com has address 74.125.227.110
google.com has IPv6 address 2607:f8b0:4000:800::1004
google.com mail is handled by 20 alt1.aspmx.l.google.com.
google.com mail is handled by 30 alt2.aspmx.l.google.com.
google.com mail is handled by 40 alt3.aspmx.l.google.com.
google.com mail is handled by 50 alt4.aspmx.l.google.com.
google.com mail is handled by 10 aspmx.l.google.com.

so at least that's working. But host fivestones.desonia does nothing. If I dig fivestones.desonia I get

; <<>> DiG 9.8.1-P1 <<>> fivestones.desonia
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 57727
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 0

;; QUESTION SECTION:
;fivestones.desonia.        IN  A

;; AUTHORITY SECTION:
fivestones.desonia. 604800  IN  SOA ns.fivestones.desonia. root.fivestones.desonia. 2013012110 604800 86400 2419200 604800

;; Query time: 1 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Mon Jan 21 23:51:40 2013
;; MSG SIZE  rcvd: 80

...which seems like it's working. But it doesn't work. And finally if I wget fivestones.desonia (the computer is running apache) I get

Resolving fivestones.desonia (fivestones.desonia)... failed: Name or service not known.
wget: unable to resolve host address `fivestones.desonia'

What am I doing wrong? Or what other info would you need to help me figure this out? Thanks so much!

3 Answers 3

3

'fivestones.desonia' is not a host name in your setup. Try the following instead.

ping www.fivestones.desonia
4
  • Perfect. Thanks so much @jdthood, I don't know how I didn't see this. One thing though--if I wanted to access the same computer by just going to say http://server how would I do that? If the host name has to be a subdomain, I can at best get to it by second level domains, not top level domains, can I?
    – fivestones
    Jan 23, 2013 at 2:34
  • I'd vote you up but I don't have enough reputation (yet)
    – fivestones
    Jan 23, 2013 at 2:38
  • 2
    You want http://desonia to bring up the website at 192.168.1.139? Then in the configuration above use 'desonia' everywhere instead of 'fivestones.desonia' and add a @ IN A 192.168.1.139 line to the file db.desonia.
    – jdthood
    Jan 23, 2013 at 15:47
  • Brilliant. You've solved all my DNS issues. Thanks!
    – fivestones
    Jan 24, 2013 at 4:12
0

Has been followed your guide completely and get everything working :)

command host -l fivestones.desonia

should return you all host in your dns zone.

check your config with sudo tail -f /var/log/syslog to see if no any errors

most possible error you make have with your config is no "zones" subfolder in your bind config, you need to create one or remove it from your paths.

Everything else is correct and working!

0
ns      IN      A       192.168.1.139
server  IN      A       192.168.1.139
www     IN      A       192.168.1.139

Multiple A records for the same IP address is not generally good practice.

Choose one name for the host, the "canonical" name" and then create CNAME "alias" records for the alternative "service" names (eg ns, ftp, www) to that canonical name, as in

server      IN      A       192.168.1.139

and

ns      CNAME   server
ftp     CNAME   server
www     CNAME   server

Then when you move a service to a second server, you add an A record for that server2 and just change to the CNAME entry to point to the second host name, eg

ftp     CNAME  server2

Similarly one should just have a single PTR record in the reverse zone file pointing to the canonical name.

$ORIGIN     1.168.192.in-addr.arpa.

139         PTR    server.fivestones.desonia.

(Note the essential trailing period on the PTR entry.)

Good DNS practice means being able to do reverse lookups as well!

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .