Running dnsmasq as an authoritative DNS server

amazon ec2authoritativednsmasqdomain-name-system

I am trying to implement a dynamic dns service for my computers. I have pointed h.lohray.com to my EC2 instance in the NS record of lohray.com and have installed dnsmasq on that system and have made sure to unblock the firewall port.

For now, I have statistically added an entry on my /etc/hosts file.

129.118.19.163 i7.h.lohray.com

however, i7.h.lohray.com does not resolve correctly with nslookup or dig 🙁 This is the only time I could have this resolved (online nslookup) – 50.19.103.190 is the IP address of the EC2 instance where dnsmasq is running. Where could I have gone wrong?

Best Answer

Your NS record for h.lohray.com is currently as follows:

h.lohray.com.       1800    IN  NS  50.19.103.190.

Which is wrong. NS records should specify not an IP addresses, but domain names of a nameservers, like this:

h.lohray.com.       1800    IN  NS  h.lohray.com
h.lohray.com.       1800    IN  A   50.19.103.190.

or like this:

h.lohray.com.       1800    IN  NS  ns.h.lohray.com
ns.h.lohray.com.        1800    IN  A   50.19.103.190.

Your DNS server at 50.19.103.190 seems to work - it answers when I query of i7.h.lohray.com