Sometimes you are working on a site and you need to test the real url on it, but you are not ready to flip the DNS entry yet.

In IIS land you could add a host header and add an entry into your hosts file and it would just work.

Now enter Azure and you could have a dev site, perhaps even a deployment slot that contains your website and you want to test it, but some of that code relies on the URL, you have a URL Rewrite perhaps.

In order to add a custom domain to Azure you need to be able to make changes to the DNS server, it leads you to make either a CNAME entry or an A Rec / TXT entry and it validates that before adding the hostname binding.

So how do you do a test on dev with the real URL and a local hosts file entry ?

Well it turns out that you only need the TXT entry to confirm ownership, which will then allow the addition of the Custom Domain to Azure.

My TXT DNS entry

How Adding a host looks, before DNS entry. Oh well you can spot my IP if you look hard enough. Its not a real site anyways.

Once you have added a TXT record and the propagation has happened, then even though you do not have an A record, or CNAME, the Custom domain will be allowed to be added, just hit that Add hostname button and its there.

Of course you cannot get to it unless you add an entry to your DNS server or hosts file for testing.