Interview Prep/Networking/DNS & Service Discovery

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 →

  1. Replace IPs with DNS names in config and resolve at connect time
  2. For firewall rules use FQDN-based rules (for example Network Firewall domain lists) or provider prefix lists
  3. Make sure the app respects DNS TTL: JVMs cache DNS forever unless networkaddress.cache.ttl is set
  4. 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.

All Networking questions Roadmap: Networking for DevOps

More on DNS & Service Discovery