Access internet from Azure VM not working [closed]
Asked Answered
H

3

11

I've created an Azure DNS server with Address 192.168.0.4
I've created a Virtual Network with address space 192.168.. I changed the Subnet-1 to be

 starting IP 192.168.10.0
 Address Count 64  
 Address Range 192.168.10.0 - 192.168.10.63  

I've created 3 virtual machine images in a single cloud service using powershell.

$ADVM = New-AzureVMConfig -Name $ADVMName -InstanceSize Small -ImageName $ADVMImageName.ImageName |
            Add-AzureProvisioningConfig -Windows -Password $AdminPassword |
            Add-AzureDataDisk -CreateNew -DiskSizeInGB 10 -DiskLabel 'datadisk2' -LUN 0  |
            Add-AzureEndpoint -Protocol tcp -LocalPort 80 -PublicPort 80 -Name 'web' -LBSetName 'lbweb' -ProbePort 80 -ProbeProtocol http -ProbePath '/'

$SQLVM = New-AzureVMConfig -Name $SQLVMName -InstanceSize Medium -ImageName $SQLImageName.ImageName |
            Add-AzureProvisioningConfig -Windows -Password $AdminPassword |
            Add-AzureDataDisk -CreateNew -DiskSizeInGB 50 -DiskLabel 'datadisk2' -LUN 0 |
            Add-AzureEndpoint -Protocol tcp -LocalPort 80 -PublicPort 80 -Name 'web' -LBSetName 'lbweb' -ProbePort 80 -ProbeProtocol http -ProbePath '/'

$APPVM = New-AzureVMConfig -Name $APPVMName -InstanceSize Large -ImageName $AppImageName.ImageName |
            Add-AzureProvisioningConfig -Windows -Password $AdminPassword |
            Add-AzureDataDisk -CreateNew -DiskSizeInGB 50 -DiskLabel 'datadisk2' -LUN 0 |
            Add-AzureEndpoint -Protocol tcp -LocalPort 80 -PublicPort 80 -Name 'web' -LBSetName 'lbweb' -ProbePort 80 -ProbeProtocol http -ProbePath '/'

#CreateService                   
New-AzureVM -ServiceName $CloudServiceName -VMs $ADVM,$SQLVM,$APPVM -AffinityGroup $AffinityGroup -VNetName $VirtualNetworkName

All the VM's and cloud service get created as expected. (although the IP addresses of the new VM's are not sequential)

I get these 3 IP addresses

192.168.0.4 for $ADVMName
192.168.0.12 for $SQLVMName
192.168.0.20 for $APPVMName

When I RDP to $ADVMName and try to access http://www.google.com it is not successful, clicking Fix connection problems says The DNS Server isn't responding.

Why cant I access google from this machine? How can the DNS server (set at 192.168.0.4) be unavailable when I'm on that machine?

Hertz answered 27/2, 2013 at 4:53 Comment(0)
M
18

I was having the same problem after I built an Azure Virtual network with one VM being a Domain Controller and two other VMs being Servers. When I logged in to any of my Virtual Machine Windows Servers running on an Azure, I was unable to open web sites with any browser (tested Chrome and Internet Explorer). Confusingly, a few sites like BING and GOOGLE would open, but all other others including MSDN and live.com had problems like no CSS or would not open.

It turns out the root cause of this issue is that the Virtual Network I created was configured with only one DNS IP Address: the IP address my AD domain controller MY-DC (10.0.0.4). This happened because I created my own isolated AD Forest (mydomain.com) controlled by my AD domain controller MY-DC which is one of my Virtual Machines.

Before I configured MY-DC to be the Domain Controller for the mydomain.com domain, the Azure Virtual Network had a DNS IP address of 168.63.129.16. That 168.63.129.16 is the IP address of a Microsoft DNS server. After configuring my Virtual Machine MY-DC to be my Domain Controller, the Azure Virtual Network only had the DNS IP address of 10.0.0.4. This change to the DNS IP address seemed to have caused browsers to be unable to open sites on the internet. The fix was to edit the configuration of the Azure Virtual Network and add back the original IP address of the Microsoft DNS server (168.63.129.16) as an additional DNS Server.

So the lesson learned is as follows. Before configuring a VM to be the DNS server of your Azure Virtual Network, carefully make note of the DNS IP Address that Windows Azure provided for your Azure Virtual Network prior to any network or domain configuration. Then, after configuring your VM to be a DNS server, switch back to the Azure management portal and navigate to the Network section. In this section click on the virtual network name. This should drill into the configuration of the network. From this screen, click on the Configure tab. Add the original DNS IP Address of the Microsoft DNS server to the list along with your own DNS Server’s IP address, so your network now knows about both DNS servers. Click Save. The portal will prompt you with a confirmation, click Yes. Restart the VM from the portal, and you will now be able to Remote Desktop to the VM, log in to Windows, open a browser, and surf the internet as easily as on your client PC.

Matrilateral answered 20/2, 2014 at 5:25 Comment(0)
P
8

Let me add one more detail to the good hint from Martin Cox - the answer is correct - the issue with you r own AD/DNS server on your virtual network is really that your onw DNS is usually not fully configured to provide full DNS service, so browsing of internet fails to find all the "web content".

So as proposed above you have to go to your azure virtual network configuration tab and add into DNS list an IP of the real (outer) DNS server.

I used the IP of actual Azure's DHCP server, which is actually the same as the DNS server address (you can find it anytime when running in any VM that's already running in your virtual network ipconfig -all, search for DHCP)

When I added this IP into DNS list of the virtual network I can browse internet from the VM as on ice ;-)

Persuasion answered 11/9, 2014 at 10:46 Comment(0)
H
0

Looks like I was getting ahead of myself in trying to access the internet before installing active directory and promoting to domain controller. After the following two steps I can now access google.

# Install AD Role
    Install-WindowsFeature -Name AD-Domain-Services
    Install-WindowsFeature -Name RSAT-ADDS


# promote to DC (http://www.falconitservices.com/support/KB/Lists/Posts/Post.aspx?ID=90)
# this command will restart machine
    Import-Module ADDSDeployment
    Install-ADDSForest -CreateDnsDelegation:$false -DatabasePath "F:\NTDS" -DomainMode "Win2012" -DomainName "x2013xxxx.com" -DomainNetbiosName "X2013xxxx" -ForestMode "Win2012" -InstallDns:$true -LogPath "F:\NTDS"         -NoRebootOnCompletion:$false -SysvolPath "F:\SYSVOL" -Force:$true
Hertz answered 27/2, 2013 at 5:45 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.