Using domains is always a good practice as you get the liberty to replace the server without having to make any changes to your application(s). Imagine you have a web application running on a single machine (HostA) and your Database running on a single machine (DB1).
A few weeks later you start getting more and more traffic and it is time to scale so you start adding web application machines and now you have HostA, HostB, HostC and HostD running your web application but as you can now see that your Database activity has also increased and you need to move your DB to a bigger and better machine. You go ahead and prepare a new machine (DB2) and now its time time for migration of applications from old DB1 to new DB2.
IP address: Make changes to your application(s), deploy to all 4 or 400 machines.
FQDN: Change the DNS record for the fqdn and it gets propagated to all the application hosts, be it 4 or 400.
If you are just starting out and do not have an infrastructure of more than 50 hosts then you can very well go ahead without DNS, but sooner or later you are going to need it. You will have more than one application running on more than one host and you will need an internal DNS service.
An alternate to DNS is using
/etc/hosts where you use an FQDN (db.example.com) in your applications and ensure that all your application hosts have a relevant entry in there hosts file, which can be managed with any configuration management tool. This is more of a hack than a solution but it works and is dead simple to maintain.