SquareScale already sets up a DNS resolver with Consul resolution built in, so your application can also access in real time services using their name.

For example, if your service is named "myproduct/backend", other services will be able to access it using myproduct-backend.service.consul : this record has a TTL set to 0 and is always up to date with the number of instances of the service. 

Here's a record example for an internal service named "myproduct/backend" that has 5 instances (hence 5 IP addresses): 

$ dig +short myproduct-backend.service.consul

Any other service wanting to access the backend service will do it through the service discovery DNS name myproduct-backend.service.consul, and one of the instances will answer, load balancing results through DNS.

Did this answer your question?