I am trying to write a Dynamic DNS updater for a domain name. I have everything working like I want it to be. Basically the chain of events are as such:
- curl my public ip address
- use a command (nslookup, whois, dig, host) to check current IP record of domain name
- compare the two
- update dns if not equal
The problem I ran into is that on site there is a local dns server which resolves the domain names to their respective local IP address instead of public IP address so that when used from inside the LAN it will use the local IP address.
How can I find out the A record of a domain straight from whois records, avoiding it querying my DNS server?