Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.
PS C:\Users\Administrator> Add-DnsServerResourceRecordCName -Name "fd3s" -HostNameAlias "rx-7.srv.world" -ZoneName "srv.world" -PassThru
HostName RecordType Type Timestamp TimeToLive RecordData
-------- ---------- ---- --------- ---------- ----------
fd3s CNAME 5 0 01:00:00 rx-7.srv.world.
PS C:\Users\Administrator> Get-DnsServerResourceRecord -ZoneName "srv.world" | Format-Table -AutoSize -Wrap
# CNAME レコードが登録された
HostName RecordType Type Timestamp TimeToLive RecordData
-------- ---------- ---- --------- ---------- ----------
@ NS 2 0 01:00:00 rx-7.srv.world.
@ SOA 6 0 01:00:00 [8][rx-7.srv.world.][hostmaster.srv.world.]
fd3s CNAME 5 0 01:00:00 rx-7.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
rx-8 MX 15 0 01:00:00 [10][rx-8.srv.world.]
# 確認
PS C:\Users\Administrator> Resolve-DnsName fd3s.srv.world -Server 127.0.0.1
Name Type TTL Section NameHost
---- ---- --- ------- --------
fd3s.srv.world CNAME 3600 Answer rx-7.srv.world
Name : rx-7.srv.world
QueryType : A
TTL : 3600
Section : Answer
IP4Address : 10.0.0.101
# 削除する場合は以下
PS C:\Users\Administrator> Remove-DnsServerResourceRecord -ZoneName "srv.world" -RRType "CNAME" -Name "fd3s" -PassThru
Confirm
Removing DNS resource record set by name fd3s of type CNAME 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
-------- ---------- ---- --------- ---------- ----------
fd3s CNAME 5 0 01:00:00 rx-7.srv.world.
|