Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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!

share|improve this question
add comment

2 Answers 2

up vote 1 down vote accepted

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

ping www.fivestones.desonia
share|improve this answer
    
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 '13 at 2:34
    
I'd vote you up but I don't have enough reputation (yet) –  fivestones Jan 23 '13 at 2:38
    
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 '13 at 15:47
    
Brilliant. You've solved all my DNS issues. Thanks! –  fivestones Jan 24 '13 at 4:12
add comment

please help about your reverse zone file you have written

     10      IN      PTR     ns.fivestones.desonia.

what this 10 means ? your forward zone does not have any IP in 10

share|improve this answer
    
This is more of a comment than an answer to the OPs question. –  Kevin Bowen Aug 9 '13 at 4:11
add comment

Your Answer

 
discard

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

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