Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.
# [-TimeToLive] には TTLの値を指定 (未指定の場合の規定は [1:00:00] (1 時間))
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] ホストが登録された
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
# 削除する場合は以下
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
|