1
votes

I've written a PowerShell script to create all the A/CNAME/MX records etc. for all my domain names.

It runs against my Azure subscription without an error.

I can go into the config section of my Azure Websites and map those domain names to my websites and it resolves the domains names correctly.

I've set the NamesServers at the registrar to the correct name servers that I'm getting back from

$zone = Get-AzureRmDnsZone –Name activistmanager.info –ResourceGroupName DNSRecords
Get-AzureRmDnsRecordSet –Name “@” –RecordType NS –Zone $zone

I can see that the domain names servers have the correct NameServers

But it doesn't work

Even using NSLOOKUP (after switching the server to the Azure DNS Servers)

I run

ls x.com

and it returns

Can't list the domain x.com:Non Existent domain
The DNS server refused to transfer the zone X.com to your computer
If This is incorrect, check the zone transfer security settings for X.com on the DNS

These zones we were resolving throughout the day as I was transferring them one by one to Azure but at some point they stopped working. What am I missing?

#---------------------------------------------------------------------------------------------
#freedomnstuff.org
#New-AzureRmDnsZone -Name freedomnstuff.org -ResourceGroupName DNSRecords
# A
$rs = New-AzureRmDnsRecordSet -Name "*" -RecordType A -ZoneName "freedomnstuff.org" -ResourceGroupName "DNSRecords" -Ttl 60 -Overwrite -Force          
Add-AzureRmDnsRecordConfig -RecordSet $rs -Ipv4Address 168.62.48.183
Set-AzureRmDnsRecordSet -RecordSet $rs -Overwrite

# CNAME

$rs = New-AzureRmDnsRecordSet -Name "awverify" -RecordType "CNAME" -ZoneName "freedomnstuff.org" -ResourceGroupName "DNSRecords" -Ttl 60 -Overwrite -Force
Add-AzureRmDnsRecordConfig -RecordSet $rs -Cname "awverify.freedomnstuff.azurewebsites.net"
Set-AzureRmDnsRecordSet -RecordSet $rs -Overwrite

$rs = New-AzureRmDnsRecordSet -Name "awverify.www" -RecordType "CNAME" -ZoneName "freedomnstuff.org" -ResourceGroupName "DNSRecords" -Ttl 60 -Overwrite -Force
Add-AzureRmDnsRecordConfig -RecordSet $rs -Cname "awverify.freedomnstuff.azurewebsites.net"
Set-AzureRmDnsRecordSet -RecordSet $rs -Overwrite

$rs = New-AzureRmDnsRecordSet -Name "www" -RecordType "CNAME" -ZoneName "freedomnstuff.org" -ResourceGroupName "DNSRecords" -Ttl 60 -Overwrite -Force
Add-AzureRmDnsRecordConfig -RecordSet $rs -Cname "freedomnstuff.org"
Set-AzureRmDnsRecordSet -RecordSet $rs -Overwrite
1
Presuming this is the domain that you've named in your powershell snippet! I've just had a look at it and it seems that the only (obvious) record that is registered is a CNAME to www - can you show the code you are using to register themMichael B
The code for one of the domains is now included above. Basically it's the code for a A record to point to the IP address and a www CNAME to point to the name specified in the A record. There are also two awverify records so the Azure portal will allow me to configure the website to accept requests to these domain names. And that's the crazy part - the Azure portal can fine it just fine - just not the real world.TRH
And here's a DNS report on the domain - looks good to me - viewdns.info/dnsreport/?domain=freedomnstuff.orgTRH
It was perhaps a propagation error, because that appears to be working now...Michael B
I'm still getting a DNS error. And it looks like it's down for everyone - downforeveryoneorjustme.com/freedomnstuff.orgTRH

1 Answers

1
votes

Ok, I've just spotted your problem!

You can't use a wildcard for the apex record.

A wildcard is for the domain record at *.example.com (notice the dot between the * and the domain) This will match something.example.com

The "@" prefix refers to the domain itself. so that will match example.com

When you make a CNAME and point it to example.com, the next look up is an A record for example.com and the wildcard domain doesn't match that. (you'd need to wild card *.com to make that match!)

Add this, and it should all work as expected...

$rs = New-AzureRmDnsRecordSet -Name "@" `
         -RecordType "A" `
         -ZoneName "freedomnstuff.org" `
         -ResourceGroupName "DNSRecords" `
         -Ttl 60 -Overwrite -Force

Add-AzureRmDnsRecordConfig -RecordSet $rs `
         -Ipv4Address 168.62.48.183

Set-AzureRmDnsRecordSet -RecordSet $rs -Overwrite