I'm trying to use Linux Bind9 to set up a DNS server for my Azure VMs in virtual network. I got one web server and one mail server. My goal is making GoDaddy connect to my own DNS server, and redirect to my web and mail servers. But I failed to doing this. Here is my configurations.
My domain: mydomain.com
web server: web.cloudapp.net IP: 10.0.1.6
mail server: mail.cloudapp.net IP: 10.0.1.5
dns server: dns.cloudapp.net IP: 10.0.1.4
**PS**: three servers all in the Azure virtual network.
dns.cloudapp.net:
/etc/network/interfaces:
auto eth0
iface eth0 inet static
address 10.0.1.4
netmask 255.255.255.0
network 10.0.1.0
broadcast 10.0.1.255
gateway 10.0.1.1
dns-nameservers 127.0.0.1
/etc/hostname:
dns
/etc/hosts:
10.0.1.4 dns.mydomain.com dns
/etc/bind/named.conf.local:
zone "mydomain.com" {
type master;
file "/etc/bind/zones/db.mydomain.com";
};
zone "1.0.10.in-addr.arpa" {
type master;
file "/etc/bind/zones/db.10.0.1";
};
/etc/bind/zones/db.mydomain.com:
$TTL 604800
@ IN SOA dns.mydomain.com. mail.mydoamin.com. (
2 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
;
mydomain.com. IN NS dns.mydomain.com.
mydomain.com. IN MX 10 mail.mydoamin.com.
mydomain.com. IN A 10.0.1.4
dns IN A 10.0.1.4
mail IN A 10.0.1.5
www IN CNAME web.cloudapp.net.
/etc/bind/zones/db.10.0.1:
$TTL 604800
@ IN SOA byc-dev-dns.bringyourchoice.net. byc-dev-em.bringyourchoice.net. (
1 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
IN NS byc-dev-dns.
4 IN PTR dns.mydoamin.com.
5 IN PTR mail.mydoamin.com.
6 IN PTR web.cloudapp.net.
/etc/resolv.conf:
Nameserver 10.0.1.4
domain mydomain.com
search mydomain.com
**PS**: this file will change each time I restart VM.
I've add the public IP address of my dns.cloudapp.net to the NS record in Godaddy.
Can anyone help me with this, and give me some explanations? Thank You.