How to set up an A-record for Azure hosted website / web role?

蹲街弑〆低调 提交于 2019-12-23 16:40:34

问题


We want to host a website on Windows Azure and it can technically be a Website or a Web role, we don't particularly care. Is there currently a way to set an A-record for either of them?

It seems that shared Websites don't support DNS entries at all and that the reserved instances support CNAME only. Do web roles support A-type DNS records?

If not, how real-world deployments on Azure deal with that? For our web site, it is absolutely necessary that it serves both www.example.com and example.com.


回答1:


[UPDATE] As of 9.17.2012 it is possible to add an A Record to a azure-web-sites instance, follow the Configuring a Custom Domain name for a Windows Azure Web Site instructions on WindowsAzure.com


A records are not possible suggested, but CNAMEs are.

Steve Marx blogged about setting up custom domains on windows azure, you'll want to take a look at that.

There is also DNSAzure, I've never tried the service and am simply stating that is a potential option. I do not guarantee it is a supported alternative, nor that it is a valid service.




回答2:


At the moment you cannot use A records or naked domains for Web Sites. For Web Roles this is possible, but there's a caveat.

Each time you deploy for the first time to an empty slot (production/staging) you will get a reserved IP address, and you'll keep this until you delete that deployment. So, you can use A records on that IP address, but beware never to delete it or you'll lose the IP address.

Quoting the Windows Azure website:

Note, however, because the lifetime of the IP address is associated with a deployment, it is important not to delete your deployment if you need the IP address to persist. Conveniently, the IP address of a given deployment slot (production or staging) is persisted when using the two upgrade mechanisms in Windows Azure: VIP swaps and in-place upgrades.




回答3:


I've been struggling with exactly this issue. I have a wildcard CNAME in DNS (route 53) to map everything for

*.example.com to example.cloudapp.net

All fine. Except the damn naked (root) domain.

I previously used 301 redirection as I had a dedicated server with a static IP. Simply had an

A record for example.com to server IP 

then in IIS a site with correct bindings with a simple

HTTP redirect (permanent 301)

Everything was just fine and life was good. Then we got rid of our dedicated server, and suddenly... No sensible way to get naked traffic to the example.cloudapp.net address ! Pain, problems, hours of Googling, hair pulling at how something so simple and so obviously necessary could be such a pain (or cost so much)...

Then ... about to throw in the towel in dismay and buy some needless hosting / service ... I stumbled upon the fantastic wwwizer.com

And joy one minute later all is sunny again



来源:https://stackoverflow.com/questions/11742559/how-to-set-up-an-a-record-for-azure-hosted-website-web-role

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!