How to create a code that reads and writes my IP into a zone file
Hi
I'm using CentOS 6, Apache, and BIND DNS.
BIND doesn't allow me to assign a CNAME record to a root-name (@ CNAME abc.abc.com), only an A record, but I have a dynamic IP address.
I think about creating a code that detects my external IP address every 60 minutes for example, and if the IP changed - update the zone file (example.com.zone).
A better explanation:
IP1 is inside the zone file: @ A IP1;
I restart my router, my IP changes.
The code runs, detects the new IP (IP2), writes it to the zone file
IP2 is inside the zone file: @ A IP2;
Do you know if it's possible? can I do it with PHP or PERL? I'm new with Linux, and I'm not sure it's even connected to Linux. Oh and don't worry: My domain is ALWAYS pointing to the right DNS server: I'm using DynDNS for that.
I'm not sure it's in the right forum or even the right website but any answer will be good!
Thanks
sorry if my English is bad...
Last edited by NS-ME; 10-15-2011 at 05:48 PM.
|