Windows Server 2019

Thêm A/PTR Record trong DNS Server

Cấu hình trên Powershell

				
					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.110" -TimeToLive 01:00:00 -CreatePtr -PassThru 

HostName                  RecordType Type       Timestamp            TimeToLive      RecordData
--------                  ---------- ----       ---------            ----------      ----------
rx-8                      A          1          0                    01:00:00        10.0.0.110

PS C:\Users\Administrator> Get-DnsServerResourceRecord -ZoneName "srv.world" | Format-Table -AutoSize -Wrap 

# [rx-8] has beed 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.110

# if remove it, run like follows
PS C:\Users\Administrator> Remove-DnsServerResourceRecord -ZoneName "srv.world" -RRType "A" -Name "rx-8" -RecordData "10.0.0.110" -PassThru 

Confirm
[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.110
				
			

Cấu hình trên GUI

Mở Server Manager và chọn Tools – DNS, Nhấn chuột phải vào  domain name,  chọn New Host(A or AAA)…

Nhập hostname và IP address bạn muốn thêm. Tích chọn Create associated pointer(PTR) record.

Vậy là một  A/PTR record đã được tạo.

Share:


Contact
Nhấn để liên hệ