Search code examples
node.jsamazon-web-servicesdnsamazon-route53

How to get DNS A record IP directly from Route 53?


I use Route 53 failover to switch to secondary server when primary fails.

I would like to stop processes on primary when secondary is live... I am considering using the IP from Route 53 as the trigger.

How can I get that IP directly from Route 53 to avoid cache delays?


Solution

  • Look in Route53 to see what the authoritative name servers for your domain are. They will appear as an NS record. Pick one of them and query it directly. For example if one of the name servers of your domain is ns1.aws.com and your A record is www.example.com then you could query for the current IP address of your A record using a tool like nslookup as so:

    nslookup www.example.com ns1.aws.com

    This will perform a DNS query directly against the authoritative name server for your domain, bypassing any DNS cache.