4

If I have the following CNAME records set up:

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

Will Dns.GetHostEntry("www.custom1.com") always return a HostName of myapp.cloudapp.net.

Essentially I'm allowing customers to use their own custom domains for an application hosted in Azure and would rather ask them to set up a CNAME record to my domain (e.g. www.myapp.com) than giving out the Azure hostname.

I'm just looking for a way to programatically check that the cname record has been set up correctly.

Yahia
  • 69,653
  • 9
  • 115
  • 144
Ben Foster
  • 34,340
  • 40
  • 176
  • 285

1 Answers1

2

Have a look at the DnDns library, it will allow you to do exactly what you are looking for. The 'How to do a DNS Name Lookup' documentation example should be easily adopted to your needs. (The example involves an A record, but changing it to a CNAME would be easy).

Nathan Anderson
  • 6,768
  • 26
  • 29