0

I originally posted this to stack-overflow because i thought they could give me some insight, But instead i just got down-voted and they didn't understand what i was talking about from the header. I'm trying make bind9 resolve My Domain Name into an IPv4 address, But bind9 Isn't detecting the resolution file I have set up called /etc/bind/db.Domain.zone or even the default local file db.local

I'm really confused on how to fix this, I sent bind9 support a request for help about month ago and I've never heard a response. The owner sent me to the community forums but i never got accepted. I've installed bind9 bind9utils bind9-doc bind9-host and I've also set up my hosts file as the following so O can link my hostname to it also

echo -e "192.168.1.101  cheese.com  chewy" >> /etc/hosts

hostnamectl set-hostname chewy

Then I was able to run ping -c cheese.com and receive a response on the same host after I enabled ICMP requests, But I'm not able to ping Evil.com from another computer in the network or outside of the network, My next was to configure the named.conf.options file for my preferences

acl TrustedPPL { 192.168.1.0/24; 192.168.1.101; };

acl NoAccess { 192.168.1.111; };

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

           allow-query { TrustedPPL; };
           blackhole { NoAccess; };

           recursion yes;

           allow-recursion { localnets; 192.168.1.0/24; };
           listen-on port 53 { 192.168.1.101; 127.0.0.1; };
           forwarders { 192.168.1.1; 8.8.8.8; 8.8.4.4; };

           dnssec-validation auto;
           dnssec-lookaside auto;
           dnssec-enable yes;
           auth-nxdomain no; 

           tcp-listen-queue 25;
           transfers-in 25;
           transfers-out 25;
           tcp-clients 200;
           };

At this point I have restarted bind9 so I would be notified of any errors, There were no errors so I proceeded to make the zone name and the zone file, I'll also include the zone files contents

echo -e 'zone "cheese.com" IN { type master; file "/etc/bind/db.Domain.zone"; };' > /etc/bind/named.conf.local


Zone file /etc/bind/db.Domain.zone

 $TTL 3h

@  IN   SOA  cheese.com. root. (
                                            15   ; Serial
                                            3h   ; Refresh
                                            1h   ; Retry
                                            1w   ; Expire
                                            1h ) ; Negative Cache TTL

@   IN    NS  cheese.com.
@   IN    A   192.168.1.101

Then i used dig cheese.com and I got a response showing that IPv4 was 192.168.1.101, Then I confirmed it with nslookup and It also came back accurate.

So i decided to test the resolution part of it and I changed @ IN A 192.168.1.101 to 192.168.1.111 I then changed the serial number and restarted bind9 with no errors, I did a dig cheese.com and it came back 192.168.1.101 again. So at this point I was curious if the file db.Domain.zone was even being detected, So I removed the file db.Domain.zone completely along with db.local, Well dig and nslookup are showing that bind9 Isn't even detecting It's own resolution file, because It's still returning 192.168.1.101 and 127.0.0.1 Any Ideas ?


This is my /etc/nsswitch.conf file

passwd:         compat systemd
group:          compat systemd
shadow:         compat
gshadow:        files

hosts:          dns 
networks:       files

protocols:      db files
services:       db files
ethers:         db files
rpc:            db files

netgroup:       nis

I've tried also tried this with the original /etc/bind/named.conf.options file and there was no change.

There is also no dnsmasq or nscd caching daemon present

The default localhost file /etc/bind/db.local was also changed from 127.0.0.1 to 127.0.1.1 before it was deleted to see if it was just my configuration, dig still returned 127.0.0.1, Can anyone confirm that this is a bind9 issue or if this is an issue with my setup

  • What is controlling the DNS on the rest of the network? Are the other computers name servers pointed to this system to get the DNS name resolution? Outside of your network do you have some sort of DDNS setup to route to your evil.com system? – Terrance Nov 22 '18 at 5:27
  • If i run nmcli dev show | grep DNS it comes back my gateway 192.168.1.1 – hello moto Nov 22 '18 at 13:33
  • You will need some sort of DDNS for Evil.com to work properly from outside the network. For internal network, you will have to add it to your router which is 192.168.1.1 somehow for it to work with the other computers on your network, or you will have to manually assign it to all your computers that you want to have access to it. Plus, Evil.com is a domain name and not a computer name. – Terrance Nov 22 '18 at 17:57
  • @Terrance it turns out that my issue was /etc/resolv.conf it has 127.0.0:53 in it, since resolv.conf had a nameserver it was over writing bind9's resolution files, so I emptied resolv.conf and added in my ipv4 and everything was working – hello moto Dec 23 '18 at 8:51
  • Hmmm, I didn't think about that one. I, myself, don't care for resolution of the new netplan stuff. So, I did follow this one in the past and made it so that my DNS goes to my DNS server and not the one built in: askubuntu.com/a/1057752/231142 – Terrance Dec 23 '18 at 14:12
1

You are trying to setup public domain on localhost. So, it fails to resolve from other locations. If you need it only for LAN, configure bind, and make all LAN PC(or routers) use that bind as DNS server.
In other case, if you trying to setup public domain, google for domain parking. Its possible to park domain on your own server, but it must have public IP, and it worst idea.

Edit(according to comment): I think it works fine, loopback interface respond on many addresses:

 leonid  JabbaDesktop  ~  $  ifconfig lo
lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 27078  bytes 2265065 (2.2 MB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 27078  bytes 2265065 (2.2 MB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

 leonid  JabbaDesktop  ~  $  ping -c 1 127.0.123.1
PING 127.0.123.1 (127.0.123.1) 56(84) bytes of data.
64 bytes from 127.0.123.1: icmp_seq=1 ttl=64 time=0.060 ms
 leonid  JabbaDesktop  ~  $  ping -c 1 127.0.123.2
PING 127.0.123.2 (127.0.123.2) 56(84) bytes of data.
64 bytes from 127.0.123.2: icmp_seq=1 ttl=64 time=0.060 ms
  • No, I setup a public domain with apache2, that's why it's setup in the /etc/hosts file also, I just tested the local host to confirm that bind9 was messing up for me, can you confirm that bind9 is working ? Even when you change 127.0.0.1 to 127.0.1.1 in /etc/bind/db.local – hello moto Nov 22 '18 at 4:37
  • Ping works because it's inside of hosts, but dig doesn't dig up bind resolution files – hello moto Nov 22 '18 at 4:54
  • 1
    Have you cleared /var/cache/bind between restarts? – LeonidMew Nov 22 '18 at 5:11
  • No I didn't even think of that, could the cache have caused that though – hello moto Nov 22 '18 at 5:13

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.

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