I have a BIND ubuntu server as a private DNS server for com
zone and two hosts (web servers). The three are virtual hosts using virtual box and connect together using a virtual host card.
I have this configuration file in the DNS server for forward resolution:
$TTL 604800
@ IN SOA dns1.com. admin.com. (
19 ; Serial
604820 ; Refresh
86600 ; Retry
2419600 ; Expire
604600 ) ; Negative Cache TTL
; name servers - NS records
IN NS dns1.com.
; name servers - A records
dns1.com. IN A 192.168.56.3
; 192.168.56.0/24 - A records
@ IN NS dns1.com.
host1. IN A 192.168.56.7
host2. IN A 192.168.56.8
I try to connect to both hosts using their domain name. The first one opens correctly. The second one can never open.
Both are pingaple. Here is the second host ping result from my machine: C:\Users\e>ping 192.168.56.8
Pinging 192.168.56.8 with 32 bytes of data:
Reply from 192.168.56.8: bytes=32 time<1ms TTL=64
Reply from 192.168.56.8: bytes=32 time<1ms TTL=64
Reply from 192.168.56.8: bytes=32 time<1ms TTL=64
I am able to resolve host2.com if I use the local host
file in my windows machine by adding this entry:
192.168.56.8 host2.com
I can not find why my DNS server can not resolve host2
but can resolve host1
?
Here is the named.conf.local
file:
zone ".com" {
type master;
file "/etc/bind/forward.host1.com";
};
zone "56.168.192.in-addr.arpa"{
type master;
file "/etc/bind/reverse.host1.com";
};
I do not think the file names forward.host1.com
reverse.host1.com
has any effect on the resolution? do they?
EDIT: To check the configurations:
/etc/bind$ sudo named-checkzone com forward.host1.com
forward.host1.com:20: ignoring out-of-zone data (host1)
forward.host1.com:21: ignoring out-of-zone data (host2)
zone com/IN: loaded serial 19
OK
Can anyone point to me why I can't resolve host2?
EDIT: After an answer suggested, the file has been updated to the followin but without any hope. I now can not reach neither host1 nor host2 although they are up and running and I can reach them by IP:
$TTL 604800
@ IN SOA dns1.com. admin.com. (
24 ; Serial
604820 ; Refresh
86600 ; Retry
2419600 ; Expire
604600 ) ; Negative Cache TTL
; name servers - NS records
IN NS dns1.com.
; name servers - A records
dns1.com IN A 192.168.56.3
; 192.168.56.0/24 - A records
@ IN NS dns1.com.
host1 IN A 192.168.56.7
host2 IN A 192.168.56.8