I have several VPC's set up in AWS, and all of my instances use provisioned IP addresses, that is - not using Elastic IP Addresses
.
When any given instance boots up, it executes a script on the machine (post networking), which gets the Instance ID, Zone ID (from local config), and region, etc - once it has this information, it updates Route 53
to update the DNS information in a private hosted zone for these instances.
The reason for this is basically so that I can use DNS for server connection strings. I have my Web server and DB servers in a private subnet, and when the Web Server connects to the DB - it just uses the staticdns.mydomain.private
which maps to the instance private IP address. This way, it doesn't require an amount of reconfiguration when the instance gets rebooted or if the IP changes for other reasons.
This is all well and good, and it works - with one caveat. There is a delay in the resolving of the new DNS mappings, I am not sure how long it is - it isn't VERY long, but it seems to be somewhat random (TTL maybe?). For this period that the resolver has the OLD IP cached, we will get connection failures from Web Server to the Database. I would much prefer that this cache was released when it was updated, but I have no clue where to even search for that.
Does anyone know if there is a way to refresh the DNS resolver cache within private zones in Route 53? I have tried using nscd
also on the server, which did not seem to help.