4

I'm trying to make my own nameserver without 8.8.8.8 or 8.8.4.4. I had it set up in the beginning but I don't know where I went wrong, all I get is

;; connection timed out; no servers could be reached

This is my zone file

zone "my-new-place.com" IN {
type master;
file "/etc/bind/my-new-place.com";
};

This is my /etc/resolv.conf file, I'm using 888 as my eth0 ipv4

search my-new-place.com
nameserver 192.168.1.888

This is my my nameserver file

$TTL 864
@ IN SOA k.my-new-place.com root.my-email.com (
 2
 3600
 900
 604800
 864
)
@ IN NS k.my-new-place.com

k.my-new-place.com IN A 89.31.143.1

This is my control file /etc/bind/named.conf.options

ACL bindMe {
192.168.1.0/24;
};

options {
directory "/var/cache/bind";
listen-on port 53 { 192.168.1.888; 127.0.0.1; };
allow-query { localhost; bindMe; };
forwarders { 192.168.1.1; };
recursion yes;
};

1 Answer 1

6

It's not entirely clear to me what is happening. I imagine that bind is not running, due to errors in your configurations, so it is unreachable. If this isn't helpful, please edit your post to include the command you're running, and additional output.

When you interact with bind, are you using systemctl? For example:

systemctl restart bind9

When you do this, does the command spit out any errors? Normally when something is wrong, it will direct you to look at journalctl. What is the system telling you is wrong?

You can check if bind is running using systemctl status bind9, or ps aux | grep named, and possibly rndc status.

Maybe you have your /etc/bind/named.conf.local correct, but you did not post one, so be sure that you have the zone entries in that file. You will need one per domain, and one per subnet served:

zone "example.tld" {
    type master;
    file "/etc/bind/zones/example.tld.zone";
};

zone "1.168.192.in-addr.arpa" {
    type master;
    file "/etc/bind/zones/192.168.1.zone";
};

Here is a working /etc/bind/named.conf.options, however, I've adjusted the IP to read .200, since .888 is not a valid IP.

    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 {
            //      0.0.0.0;
            // };

            //========================================================================
            // 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
            //========================================================================
            recursion yes;
            allow-recursion {localnets; 192.168.1.0/16;};

            forwarders {
                    192.168.1.1;
            };

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

            auth-nxdomain no;    # conform to RFC1035
            listen-on { 192.168.1.200; 127.0.0.1; };
            // listen-on-ipv6 { any; };
    };

After you've double-checked the settings, restart bind and find the logs and output to determine the problem. Please post the exact commands, and logs you've found, as there may be even more wrong and it will be hard for anybody to help without all of the details.

An additional tip would be to change one thing at a time. Change your IP, verify you still have connectivity. Then, adjust bind, etc. Take an iterative approach, and ensure that each time you make a change, you haven't broken everything else.

2
  • +1 for .888 is not a valid IP.
    – Elder Geek
    Oct 12, 2018 at 18:11
  • .888 was just used an example without using my real IPV4 mr.
    – user610658
    Oct 25, 2018 at 7:00

You must log in to answer this question.