Azure DNS - 域名未被公共互联网发现 [英] Azure DNS - Domains Not Being Found By Public Internet

查看:147
本文介绍了Azure DNS - 域名未被公共互联网发现的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我写了一个PowerShell脚本来创建我所有域名的所有A / CNAME / MX记录等。



一个错误。



我可以进入我的Azure网站的配置部分,并将这些域名映射到我的网站,并正确解析域名。



我已经将注册服务商的NamesServers设置为正在从

  $ zone = Get-AzureRmDnsZone -Name activistmanager.info -ResourceGroupName DNSRecords 
Get-AzureRmDnsRecordSet -Name@-RecordType NS -Zone $ zone
/ pre>

我可以看到域名服务器具有正确的NameServers



但它不起作用



即使使用NSLOOKUP(将服务器切换到Azure DNS服务器后)



我运行

  ls x.com 

并返回

 无法列出域名x.com:不存在域
DNS服务器拒绝将区域X.com转移到计算机
如果这不正确,请检查DNS上的X.com的区域传输安全设置

这些区域我们正在逐日解决,因为我们将它们逐个转移到Azure,但在某些时候他们停止工作。我缺少什么?

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

#CNAME

$ rs = New-AzureRmDnsRecordSet -Nameawverify-RecordType CNAME-ZoneNamefreedomnstuff.org-ResourceGroupNameDNSRecords-Ttl 60 -Overwrite -Force
Add-AzureRmDnsRecordConfig -RecordSet $ rs -Cnameawverify.freedomnstuff.azurewebsites.net
Set- AzureRmDnsRecordSet -RecordSet $ rs -Overwrite

$ rs = New-AzureRmDnsRecordSet -Nameawverify.www-RecordTypeCNAME-ZoneNamefreedomnstuff.org-ResourceGro upNameDNSRecords-Ttl 60 -Overwrite -Force
Add-AzureRmDnsRecordConfig -RecordSet $ rs -Cnameawverify.freedomnstuff.azurewebsites.net
Set-AzureRmDnsRecordSet -RecordSet $ rs -Overwrite

$ rs = New-AzureRmDnsRecordSet -Namewww-RecordTypeCNAME-ZoneNamefreedomnstuff.org-ResourceGroupNameDNSRecords-Ttl 60 -Overwrite -Force
Add-AzureRmDnsRecordConfig -RecordSet $ rs -Cnamefreedomnstuff.org
Set-AzureRmDnsRecordSet -RecordSet $ rs -Overwrite


解决方案

好的,我刚刚发现你的问题!



您不能使用通配符作为顶点记录。



通配符用于 *。example.com 上的域记录(注意*和域名)这将匹配 something.example.com



@前缀指的是域本身。所以将匹配 example.com



当您创建CNAME并将其指向example.com时,下一个查找是example.com的一个记录,通配符域不匹配。 (你需要通配符* .com来进行比赛!)



添加它,它应该按预期的方式工作...

  $ rs = New-AzureRmDnsRecordSet -Name@`
-RecordTypeA`
-ZoneNamefreedomnstuff。 org`
-ResourceGroupNameDNSRecords`
-Ttl 60 -Overwrite -Force

Add-AzureRmDnsRecordConfig -RecordSet $ rs`
-Ipv4Address 168.62.48.183

Set-AzureRmDnsRecordSet -RecordSet $ rs -Overwrite


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

解决方案

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

这篇关于Azure DNS - 域名未被公共互联网发现的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆