In my earlier blog DNS: All you need to know, I had pen down my thoughts about how DNS services are generally sliced in the industry. This blog is a continuation of it detailing how Dynamic DNS service could be utilised between three different service providers.
Below was my previous setup:
ISP
BT (British Telecom) is my ISP. As since I’m a residential broadband customer, I don’t have a choice to get a static IP address. Hence the lookout for Dynamic DNS service to fill the gap. Allowing me to access services hosted at home network when I’m away.
Domain Registrar and Name-Server Provider:
DynDNS has been myregistrar and also provided Name-Server service for few years now. As Name-Server service is coming up to renew, I thought about exploring the market for cheaper alternatives. As the cost of being with DynDNS was higher to my liking. To be fair, DynDNS provide excellent service and has few bells and whistles offered along with their service offering. But my use-case i.e. running a personal site doesn’t warrant paying for things I don’t use.
This is my current setup:
ISP:
No change here
Domain Registrar and Name-Server Provider:
Split the Name-Server service from DynDNS and moved it to Amazon Route 53.
Major drawback splitting the service from DynDNS was the complexity it added or should I say brought to light which was hidden away in router softwares. All routers that support Dynamic DNS, provides a nice user interface to update DNS record every time your external IP changes. Unfortunately Amazon Route53 isn’t one among those supported options. Hence the need to have a service that monitors the external IP change and updates the Amazon Route53 record accordly.
Below is script that exactly does that, feel free to use and extend as you seem fit. I’m making following assumption in the script
- You are running it on *nix based system and the script is scheduled to run every x mins
- You have AWS account and know your zone details
- You have installed and configured AWS CLI python client with your credentials
Note: Replace AWS_HOSTED_ID and RECORDSET values with your respective once.