Can’t you setup a DNS entry on your domain that resolves to 127.0.0.1 that you reference instead of localhost?
I doubt it is at all common in end user environments, but unbound for instance can be configured to prevent local IPs from being resolved in other domains. It's a good practice to follow in a datacenter environment if you're connecting out to hostnames you resolve from DNS you don't control.