Hi All,
I have a website hosted at some web hosting company. Let me call it ' http://www.example.com '.
I have installed bind9 in one of the local server (private IP), called ' ns.example.com '. I have named zone as ' example.com ', same as my website.
Following is a forward zone file for ' example.com ' in box with hostname ' ns.example.com '
Code:
$ cat db.example.com
$TTL 86400 ; (1 day)
$ORIGIN example.com.
@ IN SOA ns.example.com. admin.example.com. (
2015042601 ; serial YYYYMMDDnn
14400 ; refresh (4 hours)
1800 ; retry (30 minutes)
1209600 ; expire (2 weeks)
3600 ) ; minimum (1 hour)
@ IN NS ns.example.com.
ns IN A 192.168.1.7
localhost IN A 127.0.0.1
sql IN A 192.168.1.100
ftp IN A 192.168.1.101
Following is a reverse zone file for ' example.com ' in box with hostname ' ns.example.com '
Code:
$ cat db.192.168.1
$TTL 86400 ; (1 day)
$ORIGIN 1.168.192.in-addr.arpa.
@ IN SOA ns.example.com. admin.example.com. (
2015042601 ; serial YYYYMMDDnn
14400 ; refresh (4 hours)
1800 ; retry (30 minutes)
1209600 ; expire (2 weeks)
3600 ) ; minimum (1 hour)
@ IN NS ns.example.com.
7 IN PTR ns.example.com.
100 IN PTR sql.example.com.
101 IN PTR ftp.example.com.
resolve.conf
Code:
$ cat /etc/resolv.conf
search example.com
nameserver 192.168.1.7
Everything works perfectly fine. Only problem is, this bind server is unable to resolve http://www.example.com, which is my actual website.
Code:
$ nslookup linuxquestions.org
Server: 192.168.1.7
Address: 192.168.1.7#53
Non-authoritative answer:
Name: linuxquestions.org
Address: 75.126.162.205
$ nslookup example.com
Server: 192.168.1.7
Address: 192.168.1.7#53
*** Can't find example.com: No answer
My bind server is recursive, and I dont want to use other public dns servers. Also my root hints are latest.
How do I resolve my website IP address?
Thanks
NOTE: my actual website name is different. I have used example.com just for illustration only. My bind server will resolve real www.example.com.
Code:
$ nslookup example.com
Server: 192.168.1.7
Address: 192.168.1.7#53
Non-authoritative answer:
Name: example.com
Address: 93.184.216.34