What happens when a service uses a hardcoded IP and the provider changes it, and how do you prevent it?
IntermediateScenarioDNS & Service Discovery
Answer
Situation read → Pinned IPs in configs and firewall rules break silently when cloud endpoints rotate.
What I'd do →
- Replace IPs with DNS names in config and resolve at connect time
- For firewall rules use FQDN-based rules (for example Network Firewall domain lists) or provider prefix lists
- Make sure the app respects DNS TTL: JVMs cache DNS forever unless
networkaddress.cache.ttlis set - Alert on connection failures to the old IP
Why → Cloud load balancers and CDNs change IPs often; the name is the stable contract.
Interview tip → Mention the JVM DNS cache example; interviewers love it.
More on DNS & Service Discovery
A customer types www.example.com in a browser. Walk through how DNS resolves it.BeginnerWhat is the difference between an A record and a CNAME, and when do you use each?BeginnerWhy can't you put a CNAME at the zone apex, and what do you use instead?BeginnerYou are moving a site to a new server. What do you do with DNS to make the cutover smooth?BeginnerHow do you find which nameservers are authoritative for a domain and query them directly?BeginnerWhat DNS records do you set up for company email?Beginner