Decouple your components
Software engineers are taught SOLID principles. The L stands for Loose coupling. Loosely coupled software components are seen as a must if you are going to create software that is not brittle, easy to maintain, and testable. The same principle is used at an infrastructure level.
Consider the following application hosted in the cloud
The machine instance has a public IP address of 52.211.55.38. But this could change. If stopped the machine instance and then start the machine image again it will get a new IP address. This would be a nightmare for any application wanting to connect to this instance on long-term basis. We could replace the machine instance IP with an elastic IP, but these are limited and chargeable resources.
A better approach would be to use some kind of naming server (like a DNS)
The DNS decouples the user (browser/mobile phone) from having to know the IP addess of machine instance.