: Hosting on Azure VM - how to handle A records? I have a VM in setup in Azure that I want to use to host multiple websites but can't figure out how to setup an A record when Azure doesn't
I have a VM in setup in Azure that I want to use to host multiple websites but can't figure out how to setup an A record when Azure doesn't give you a static IP.
I've created a CNAME, to map "www" - but how to map the root - "Http"?
It seems the virtual IP that is given won't work because if you have to shut it down for any reason you lose it and you can't get a PIP without configuring a VNet…does this right? Seems a pretty basic thing - getting an IP for a VM.
More posts by @Gonzalez347
2 Comments
Sorted by latest first Latest Oldest Best
Easiest answer is to use something like the 'naked domain redirect' from wwwizer, so all you do is point your A record to 174.129.25.170 and they automatically redirect to your www subdomain.
It is very simple but if you want to read more see their page explaining it further: wwwizer.com/naked-domain-redirect
You need to get a Reserved IP address and assign it to your virtual machine. As far as I can tell, at the moment, setting this up requires you to use the Azure PowerShell cmdlets. I have never seen the option for it in the web portal.
Microsoft documents this as follows:
First, create a Reserved IP for your subscription. You can use the following example, replacing items in "" with values specific to your
deployment.
New-AzureReservedIP -ReservedIPName "MyReservedIP" -Label "ReservedIPLabel" -Location "East US"
Once a Reserved IP has been created in your subscription, you can then associate it with a new cloud service. In the example below, a
new cloud service named "MyCloudServers" will be created and
associated with the Reserved IP "MyReservedIP". A virtual machine
"CloudServer1" will be deployed to the new cloud service using the
specified parameters and image. Note that the location of the new
cloud service must be in the same region as the Reserved IP.
New-AzureVMConfig -Name "CloudServer1" -InstanceSize "Small" -ImageName "Name_of_image" | Add-AzureProvisioningConfig -Windows -AdminUsername "cloudadmin" -Password "ABC123" | New-AzureVM -ServiceName "MyCloudServers" -ReservedIPName "MyReservedIP" -Location "East US"
(And beware of copying and pasting Microsoft's examples from MSDN; they're littered with stupid "smart" quotes and other garbage.)
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.