Estimated Reading Time: 1 min
Sometimes you need to access your application at a specific URL during the build.
As it is not possible to modify the
/etc/hosts file or run your own DNS server on the build VMs, we recommend you use a wildcard DNS service instead.
There are a couple different services available for you to use, the two we would recommend are
lvh.me and xip.io.
This service is very straight forward. Any request to a subdomain of
lvh.me will resolve to
$ nslookup database.lvh.me Server: 22.214.171.124 Address: 126.96.36.199#53 Non-authoritative answer: Name: database.lvh.me Address: 127.0.0.1
If you need more flexility with regards to the resolved IP address we recommend xip.io.
You can configure the IP address as part of the domain name. A name like
www.127.0.1.1.xip.io will resolve to the
127.0.1.1 IP address.
$ nslookup database.127.0.0.1.xip.io Server: 188.8.131.52 Address: 184.108.40.206#53 Non-authoritative answer: Name: database.127.0.0.1.xip.io Address: 127.0.0.1
In most cases this additional flexibility is not required, as you can’t modify the IPs of the build VMs. You can however make use of this with other loopback ip addresses.