我试图更新DNS记录是在(我相信)服务器上的以下路径:如何更新DNS记录通过编程
ServerName -> Forward Lookup Zones -> domain.com -> test
当DNS记录被称为test
,并类型Host(A)
。
我从here下载的DNSShell
模块,并试图用这个命令更改DNS记录的“数据”列(其中包含一个IP地址):
Set-DNSRecord -Identity "test.domain.com"
但我得到这个错误:
Cannot validate argument on parameter 'Identity'. The argument "test.domain.com" does not match the "^\\.\root\MicrosoftDNS:MicrosoftDNS_" pattern. Supply an argument that matches "^\\.\root\MicrosoftDNS:MicrosoftDNS_" and try the command again.
所以我更新了Identity
参数如下:
Set-DNSRecord -Identity "\\Servername\root\MicrosoftDNS:MicrosoftDNS_"
但现在我看到:
Set-DNSRecord : Specified argument was out of the range of the valid values. Parameter name: Path
当我尝试添加-Path
,它说,没有这样的参数!有谁知道我需要在哪里添加DNS的test.domain.com
部分来告诉命令要更新哪条记录?这个模块的文档对于这部分是不完整的,我似乎找不到任何替代品。
我可以拨打Get-DNSRecord
并查看我需要更新的记录,但任何对Set
的尝试都会被阻止,因为我不知道如何构建这些路径。
任何帮助,非常感谢。
感谢您添加此 - 不幸的是,这只适用于Windows 8,8。1,10和Server 2012 R2,所以我不能使用它,但这可能会对其他人有所帮助 – Bassie