Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.
# for [-TimeToLive], set TTL value (if not specified, default [1:00:00] is set(an hour))
PS C:\Users\Administrator> Add-DnsServerResourceRecordA -Name "rx-8" -ZoneName "srv.world" -IPv4Address "10.0.0.102" -TimeToLive 01:00:00 -CreatePtr -PassThru
HostName RecordType Type Timestamp TimeToLive RecordData
-------- ---------- ---- --------- ---------- ----------
rx-8 A 1 0 01:00:00 10.0.0.102
PS C:\Users\Administrator> Get-DnsServerResourceRecord -ZoneName "srv.world" | Format-Table -AutoSize -Wrap
# [rx-8] has been added
HostName RecordType Type Timestamp TimeToLive RecordData
-------- ---------- ---- --------- ---------- ----------
@ NS 2 0 01:00:00 rx-7.srv.world.
@ SOA 6 0 01:00:00 [2][rx-7.srv.world.][hostmaster.srv.world.]
rx-7 A 1 0 01:00:00 10.0.0.101
rx-8 A 1 0 01:00:00 10.0.0.102
# if remove it, run like follows
PS C:\Users\Administrator> Remove-DnsServerResourceRecord -ZoneName "srv.world" -RRType "A" -Name "rx-8" -RecordData "10.0.0.102" -PassThru
Confirm
Removing DNS resource record rx-8 of type A from zone srv.world on RX-7 server. Do you want to continue?
[Y] Yes [N] No [S] Suspend [?] Help (default is "Y"): Y
HostName RecordType Type Timestamp TimeToLive RecordData
-------- ---------- ---- --------- ---------- ----------
rx-8 A 1 0 01:00:00 10.0.0.102
|