Check cname entry

If I have the following CNAME records installed:

www.custom1.com CNAME www.myapp.com www.myapp.com CNAME myapp.cloudapp.net 

Will Dns.GetHostEntry("www.custom1.com") always return the hostname myapp.cloudapp.net.

Essentially, I allow customers to use their own domains for an application hosted on Azure, and would rather ask them to set up a CNAME record in my domain (for example, www.myapp.com) than give out the Azure host name.

I'm just looking for a way to programmatically validate a cname entry.

+4
source share
1 answer

Look at the DnDns library , this will allow you to do exactly what you are looking for. Example document How to make a DNS lookup name should be easily adopted according to your needs. (The example includes an A record, but changing it to CNAME would be easy).

+2
source

All Articles