我試圖更新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