0

I want to build a server at home and in order to serve subdomains I have to offer a DNS service. After several attempts and having followed many tutorials, I still have not been able to accomplish it. This is my configuration:

  • LAN is 192.168.178.0/24
  • server's hostname is zotac and it's IP is 192.168.178.10
  • The domain's name should be spiti
  • The subdomains should be reached by typing financer.spiti, fotos.spiti, wiki.spiti and so on in the browser from any device in the LAN
  • bind9 is installed and running on zotac
  • named-checkconf /etc/bind/named.conf throws no errors

Configuration files:

/etc/bind/named.conf.local

zone "spiti" {
        type master;
        file "/etc/bind/db.spiti";
};

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

/etc/bind/named.conf.options

options {
        directory "/var/cache/bind";
        forwarders {
                1.1.1.1;
                1.0.0.1;
        };
        dnssec-validation auto;

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

Zone "spiti":/etc/bind/db.spiti

$TTL    604800
@       IN      SOA     ns.spiti. root.localhost. (
                     2015121701         ; Serial
                         604800         ; Refresh
                          86400         ; Retry
                        2419200         ; Expire
                         604800 )       ; Negative Cache TTL
;
@       IN      NS      ns.spiti.
@       IN      A       192.168.178.10

ns              IN      A       192.168.178.10
localhost       IN      A       127.0.0.1
zotac           CNAME   A       ns
spiti           CNAME   A       ns

Reverse lookup:/etc/bind/db.178.168.192

$TTL    604800
@       IN      SOA     ns.spiti. root.localhost. (
                     2015121701         ; Serial
                         604800         ; Refresh
                          86400         ; Retry
                        2419200         ; Expire
                         604800 )       ; Negative Cache TTL
;
@       IN      NS      ns.spiti.
10      IN      PTR     financer.spiti.
10      IN      PTR     fotopoulos.spiti.
10      IN      PTR     spiti.

  • curl zotac returns the index.html content under the apache home folder: ok.
  • curl spiti returns Could not resolve host: spiti : not ok
  • When I configure my modem-router to use my server as DNS server, no device has connection to internet.

What am I doing wrong?


@grawity , thanks for the tool, I did not know it. Unfortunately, I have no other ubuntu machine in the LAN, but if I do it from zotac, I get following:

dig zotac. @192.168.178.10


; <<>> DiG 9.11.3-1ubuntu1.3-Ubuntu <<>> zotac. @192.168.178.10
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 21239
;; flags: qr rd ra ad; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
; COOKIE: 3dbe6e33d4fd4f8919a248005c61bb9c52a74f69dd33aeb4 (good)
;; QUESTION SECTION:
;zotac.                         IN      A
;; AUTHORITY SECTION:
.                       3509    IN      SOA     a.root-servers.net. nstld.verisign-grs.com. 2019021101 1800 900 604800 86400
;; Query time: 0 msec
;; SERVER: 192.168.178.10#53(192.168.178.10)
;; WHEN: Mon Feb 11 19:14:52 CET 2019
;; MSG SIZE  rcvd: 137

dig spiti. @192.168.178.10

; <<>> DiG 9.11.3-1ubuntu1.3-Ubuntu <<>> spiti. @192.168.178.10 ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 35818 ;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 1 ;; OPT PSEUDOSECTION: ; EDNS: version: 0, flags:; udp: 4096 ; COOKIE: 33c2f859bcd0fa769901e53a5c61bb35a046cc36e6bea06b (good) ;; QUESTION SECTION: ;spiti. IN A ;; Query time: 0 msec ;; SERVER: 192.168.178.10#53(192.168.178.10) ;; WHEN: Mon Feb 11 19:13:09 CET 2019 ;; MSG SIZE rcvd: 62

  • dnsmasq is so much simpler, FYI. – multithr3at3d Feb 10 at 22:11
  • Except in how it invents its own zone syntax instead of using the standard format, and tries to be a DHCP & TFTP & SLAAC server at the same time as a DNS server, and in this particular case probably isn't where the problem lies anyway... – grawity Feb 10 at 22:14
  • @elserra: What results do you get from dig zotac.spiti. @192.168.178.10, dig spiti.spiti. @192.168.178.10, and dig spiti. @192.168.178.10 from another machine? – grawity Feb 10 at 22:15
  • @grawity Thanks for the info, I updated the post with the output of dig – elserra Feb 11 at 11:58

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.