I am trying to configure a DNS for an Ubuntu server. Initially I had problems pinging the server or doing any kind of dig. The relevant info up to that point is visible below under "Old Issues". Through much assistance I have gotten the DNS to respond to a ping request via its IP, and most importantly it is now acknowledging the dig -x 127.0.0.1 command.
These prior issues came about due to an error in my name server syntax in the Forward Zone File (eg. db.example.com.).
Currently the issue remains that the server can not be called by the example.com. I can only assume that this is a problem with my reference to the recursive DNS server, however I am unsure of how to fix this. All help is appreciated.
Old Issues
As per requested, below are the results for various ping requests, digs, and what is entered into bind named.config prior to any suggestions.
"ping example.com" times out and outputs:
ping: unknown host example.com
"ping 1.2.3.4" (net ip) outputs:
10 packets transmitted, 10 received, 0% packet loss, time 8999ms
rtt min/avg/max/mdev = 0.688/0.960/3.221/0.754 ms
"ping 1.2.3.4" (local ip) outputs:
PING 192.168.1.68 (192.168.1.68) 56(84) bytes of data.
^C
--- 192.168.1.68 ping statistics ---
21 packets transmitted, 0 received, 100% packet loss, time 19999ms
"ping 4.2.2.2" outputs:
5 packets transmitted, 5 received, 0% packet loss, time 4006ms
rtt min/avg/max/mdev = 32.742/33.081/33.544/0.411 ms
bind named.conf file:
include "/etc/bind/named.conf.options";
include "/etc/bind/named.conf.local";
include "/etc/bind/named.conf.default-zones";
resolv.conf file:
version 1
nameserver 127.0.0.1
nameserver 4.2.2.2
version 2
search example.com
nameserver 192.168.1.1
nameserver 68.238.64.12
nslookup google.com
Server: 192.168.1.1
Address: 192.168.1.1#53
Non-authoritative answer:
Name: google.com
Address: 74.125.45.100
Name: google.com
Address: 74.125.53.100
Name: google.com
Address: 74.125.67.100
New Issues
dig -x 127.0.0.1 this line seems to be of concern, shouldn't these 0's be 1's?
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 0
cat /etc/bind/named.conf.options
cat /var/log/syslog | grep bind
named.conf.local
zone "example.com"{
type master;
file "/etc/bind/db.example.com";
};
zone "1.168.192.in-addr.arpa" {
type master;
file "/etc/bind/db.233";
};
Best Answer
netstat -rn
)ping 4.2.2.2
)cat /etc/resolv.conf
)nslookup google.com 4.2.2.2
)nameserver 4.2.2.2
in your/etc/resolv.conf
, if you want just name resolution working aka pinging any site by name.named.conf
, by the way, it must work out of the box as caching server.