Bind dns resolving local servers
Hello - I have had bind9 installed and running on my server for some time now. However, I have never been able to do a lookup on a specific server on my network to get the IP or vise verse. I have looked at multiple forums and seems that there are so many different configurations. Thank you in advance for any guidance.
Here is my setup
server001.linux-network.home - 192.168.1.105 (Bind DNS Server) {Ubuntu 16.04 with latest updates}
server002.linux-network.home - 192.168.1.110 (Virtual testing server) {Centos7 }
server003.linux-network.home - 192.168.1.111 (Virtual testing server) {Centos7}
All my devices on the network use server001 IP for DNS and able to access the internet without a problem. using dig to find name servers for google.com for example works great.
The issues I am having is when I do a lookup for server001,2 or 3 weather it is hostname or fqdn I am not getting an IP address. I am also not getting a host name when I lookup the IP address of one of the servers.
Here is what I get when I dig the ip of server002
http://kc-linux.com/download/digip.PNG
Here is what I get when I dig the hostname or fqdn
http://kc-linux.com/download/digfqdn.PNG
Here is what I get when I run nslookup from my windows box.
http://kc-linux.com/download/nslookup.PNG
Here are my bind config files.
db.192
http://kc-linux.com/download/db192.PNG
db.linux-network.home
http://kc-linux.com/download/db.linux-network.home.PNG
named.conf.local
http://kc-linux.com/download/named.conf.local.PNG
named.conf.options
http://kc-linux.com/download/named.conf.options.PNG
Re: Bind dns resolving local servers
Any chance that you could fix the formatting of your listings?
Your db.192 file looks incorrect.
Re: Bind dns resolving local servers
Hi brent1975.
A few thoughts:
I think you want to use zone "linux-network.home" instead of "linux-master.com" in named.conf.local.
In order for client to resolve hostnames (no domain, like server002), they need to have the proper 'search' and/or 'domain'. These are passed by the DHCP server. Who is handling DHCP?
The zone "1.168.192.in-addr.arpa" (file /etc/bind/db.192) should resolve single digits, like 101 for server001. For example:
Code:
; PTR Records
105 IN PTR server001.linux-network.home.
Could you please paste again the files so spaces and newlines are respected?
Regards.
Re: Bind dns resolving local servers
It doesn't hurt reading little basic documentation too: https://help.ubuntu.com/lts/servergu...ion.html.en-GB
In your forward zone file, in the IN SOA line, the domain and admin email address need to finish with a DOT. In your case they don't. This will prevent correct zone functioning.
And your CNAMEs are wrong. You can't make a CNAME saying server1 is alias to server1.domain.com. That is the point of the zone file, the domain.com part is automatically added.
Follow the instructions in my link, make a basic zone file first, fix the DOTs you are missing and delete the CNAME records. Restart bind and check if it worked.
Re: Bind dns resolving local servers
Quote:
Originally Posted by
papibe
Hi brent1975.
A few thoughts:
I think you want to use zone "linux-network.home" instead of "linux-master.com" in named.conf.local.
In order for client to resolve hostnames (no domain, like server002), they need to have the proper 'search' and/or 'domain'. These are passed by the DHCP server. Who is handling DHCP?
The zone "1.168.192.in-addr.arpa" (file /etc/bind/db.192) should resolve single digits, like 101 for server001. For example:
Code:
; PTR Records
105 IN PTR server001.linux-network.home.
Could you please paste again the files so spaces and newlines are respected?
Regards.
Thanks for the response. I corrected the zone. my understanding for the zone file db.192 "105" for example is supposed to be the last octet of the device IP. I don't use dhcp on my network.
Re: Bind dns resolving local servers
I will try one more time because you don't seem to be reading all the replies. Your db.linux-network.home has major errors. Did you see my previous post and read the document?
You need to fix that. The reverse zone is the least of your problems, it is rarely used anyway. The nslookup you posted is for the forward zone. And that still needs fixing if it looks like your post #1.
Re: Bind dns resolving local servers
Quote:
Originally Posted by
darkod
I will try one more time because you don't seem to be reading all the replies. Your db.linux-network.home has major errors. Did you see my previous post and read the document?
You need to fix that. The reverse zone is the least of your problems, it is rarely used anyway. The nslookup you posted is for the forward zone. And that still needs fixing if it looks like your post #1.
I read your post. I created a new one and this what I have.
http://kc-linux.com/download/db.linux-network2.PNG
When I do a dig on ns now I get:
http://kc-linux.com/download/dig.ns.PNG
I am at least getting answers now. However, I was thinking it should have my server listed. not root-servers.net.
Re: Bind dns resolving local servers
"dig" does not auto append the dns-search stuff (the rest of the FQDN). nslookup does.
Example:
Code:
doug@DOUG-64:~$ dig s15
; <<>> DiG 9.10.3-P4-Ubuntu <<>> s15
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 6290
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;s15. IN A
;; AUTHORITY SECTION:
. 10800 IN SOA a.root-servers.net. nstld.verisign-grs.com. 2018052500 1800 900 604800 86400
;; Query time: 200 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Fri May 25 07:21:41 PDT 2018
;; MSG SIZE rcvd: 107
doug@DOUG-64:~$ nslookup s15
Server: 127.0.0.1
Address: 127.0.0.1#53
Name: s15.smythies.com
Address: 192.168.111.112
doug@DOUG-64:~$ dig s15.smythies.com
; <<>> DiG 9.10.3-P4-Ubuntu <<>> s15.smythies.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 45975
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 2
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;s15.smythies.com. IN A
;; ANSWER SECTION:
s15.smythies.com. 604800 IN A 192.168.111.112
;; AUTHORITY SECTION:
smythies.com. 604800 IN NS ns1.smythies.com.
;; ADDITIONAL SECTION:
ns1.smythies.com. 604800 IN A 192.168.111.1
;; Query time: 0 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Fri May 25 07:24:03 PDT 2018
;; MSG SIZE rcvd: 95
doug@DOUG-64:~$
Re: Bind dns resolving local servers
The IN SOA line is still wrong. It should contain the domain name, not the FQDN of the server. It should be:
Code:
@ IN SOA linux-network.home. root.linux-network.home. (
Then, the A record for server001 should be:
Code:
server001 IN A 192.168.1.105
You don't need to have the ns A record you set up now if you don't need it. In the documentation they use ns because that is what they call the server. Yours is server001.
Re: Bind dns resolving local servers