0

I have tried making a dns server, but when i do the dig command the server returns nothing. I have not had any prior experiences and am only following this tutorial: http://www.itzgeek.com/how-tos/linux/centos-how-tos/configure-dns-bind-server-on-centos-7-rhel-7.html.

named.conf file:

//
// named.conf
//
// Provided by Red Hat bind package to configure the ISC BIND named(8) DNS
// server as a caching only nameserver (as a localhost DNS resolver only).
//
// See /usr/share/doc/bind*/sample/ for example named configuration files.
//

options {
        listen-on port 53 { 127.0.0.1;192.168.38.103; };
        listen-on-v6 port 53 { ::1; };
        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; 192.168.38.0/24; };

        /*
         - If you are building an AUTHORITATIVE DNS server, do NOT enable recursion.
         - If you are building a RECURSIVE (caching) DNS server, you need to enable
           recursion.
         - If your recursive DNS server has a public IP address, you MUST enable access
           control to limit queries to your legitimate users. Failing to do so will
           cause your server to become part of large scale DNS amplification
           attacks. Implementing BCP38 within your network would greatly
           reduce such attack surface
        */
        recursion yes;

        dnssec-enable yes;
        dnssec-validation yes;
        dnssec-lookaside auto;

        /* Path to ISC DLV key */
        bindkeys-file "/etc/named.iscdlv.key";

        managed-keys-directory "/var/named/dynamic";

        pid-file "/run/named/named.pid";
        session-keyfile "/run/named/session.key";
};

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

zone "." IN {
        type hint;
        file "named.ca";
};

zone "dynavio.coop" IN {
        type master;
        file "fwd.dynavio.coop.db";
        dnssec-enable yes;
        dnssec-validation yes;
        dnssec-lookaside auto;

        /* Path to ISC DLV key */
        bindkeys-file "/etc/named.iscdlv.key";

        managed-keys-directory "/var/named/dynamic";

        pid-file "/run/named/named.pid";
        session-keyfile "/run/named/session.key";
};

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

zone "." IN {
        type hint;
        file "named.ca";
};

zone "dynavio.coop" IN {
        type master;
        file "fwd.dynavio.coop.db";
        allow-update { none; };
};

zone "38.168.192.in-addr.arpa" IN {
        type master;
        file "38.168.192.db";
        allow-update { none; };
};

include "/etc/named.rfc1912.zones";
include "/etc/named.root.key";

fwd.dynavio.coop.db file:

$TTL 86400
@   IN  SOA         primary.dynavio.coop. root.dynavio.coop. (
2014112511      ;Serial
3600            ;Refresh
1800            ;Retry
604800          ;Expire
86400           ;MinimumTTL
)
;Name Server Information
@       IN      NS primary.dynavio.coop.
;IP Address of Name Server
primary IN  A      192.168.38.8
;Mail exchanger
dynavio.coop.  IN  MX 10   mail.dynavio.coop.
;A - Record HostName To Ip Address
www     IN  A       192.168.38.100
mail    IN  A       192.168.38.150
;CNAME record
ftp     IN CNAME        www.dynavio.coop.

38.168.192.db file:

$TTL 86400
@   IN  SOA         primary.dynavio.coop. root.dynavio.coop. (
2014112511      ;Serial
3600            ;Refresh
1800            ;Retry
604800          ;Expire
86400           ;Minimum TTL
)
;Name Server Information
@ IN  NS      primary.dynavio.coop.
;Reverse lookup for Name Server
8       IN   PTR     primary.dynavio.coop.
;PTR Record IP address to HostName
100     IN   PTR     www.dynavio.coop.
150     IN   PTR     mail.dynavio.coop.

Dig command returns:

; <<>> DiG 9.9.4-RedHat-9.9.4-18.el7_1.5 <<>> www.dynavio.coop
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 43498
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 0

;; QUESTION SECTION:
;www.dynavio.coop.              IN      A

;; AUTHORITY SECTION:
coop.                   1272    IN      SOA     coop1.dyntld.net. support.nic.coop. 2015099691 900 1800 6048000 3600

;; Query time: 3 msec
;; SERVER: 192.168.38.1#53(192.168.38.1)
;; WHEN: Mon Dec 07 16:36:55 EET 2015
;; MSG SIZE  rcvd: 98

Update: It looks like the issue is with /etc/resolv.conf being overwritten any time network manager is restarted. I will update this again later when I'm able to get the if-cfg file.

  • Are you 'digging' from the same linux box as is running bind? I'll have a look for you later this evening and see if i can help you out. you might also want to try the command host -v -a -l dynavio.coop and see what it says (if anything) Also looks like your domain name is not registered.? [test@server ~]# whois dynavio.coop [Querying whois.nic.coop] [whois.nic.coop] DOMAIN NOT FOUND – user3788685 Dec 7 '15 at 15:41
0

I loaded your zone into my test box and it works for me;

[test@server ~]# dig www.dynavio.coop

; <<>> DiG 9.8.2rc1-RedHat-9.8.2-0.37.rc1.el6_7.4 <<>> www.dynavio.coop
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 23763
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 1

;; QUESTION SECTION:
;www.dynavio.coop.              IN      A

;; ANSWER SECTION:
www.dynavio.coop.       86400   IN      A       192.168.38.100

;; AUTHORITY SECTION:
dynavio.coop.           86400   IN      NS      ns0.test.int.

;; ADDITIONAL SECTION:
ns0.test.int.           3600    IN      A       172.16.0.2

;; Query time: 0 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Tue Dec  8 20:30:27 2015
;; MSG SIZE  rcvd: 92

Note that I had to use my own NS addresses as I'm configured for a different subnet etc, and I don't have DNS Keys setup so am unable to test that.

A couple of things to check;

What have you got set in /etc/resolv.conf You should have a line like this; nameserver 127.0.0.1 so that your box asks its self for NS lookups I suspect your machine is configured to use another DNS server.

What's the IP address of you box - you had an error in your original question with primary having a reverse address of .8 and a forward of .103

  • Yes, the resolv.conf file is the problem... Everytime i restart Network Manager the changes i have made are gone... – Jojo Coana Dec 8 '15 at 20:55
  • is your box configured for dhcp on its network interfaces? – user3788685 Dec 8 '15 at 20:56
  • I haven't touched NM on my box, so i guess no. – Jojo Coana Dec 8 '15 at 20:57
  • can you show us the output from /etc/sysconfig/network-scripts/ifcfg-eth0 please – user3788685 Dec 8 '15 at 20:59
  • Right now i am on my phone, so sorry but no. – Jojo Coana Dec 8 '15 at 21:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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