DNS Server : Install
Configure DNS Server to provide feature of resolving Hostname or IP Address.
On CUI installation, set like follows.
[1] Run PowerShell with Admin Privilege and Install DNS Server.
Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.
# install DNS with admin tools
PS C:\Users\Administrator> Install-WindowsFeature DNS -IncludeManagementTools
Success Restart Needed Exit Code Feature Result
------- -------------- --------- --------------
True Yes SuccessRest... {DNS Server, ...
WARNING: You must restart this server to finish the installation process.
# restart computer to apply changes
PS C:\Users\Administrator> Restart-Computer -Force
DNS Server : Install (GUI)
On GUI installation, set like follows.
[2] Run Server Manager and Click [Add roles and features].
[3] Click [Next] button.
[4] Select [Role-based or feature-based installation].
[5] Select a Host which you'd like to add services.
[6] Check a box [DNS Server].
[7] Addtional features are required to add DNS Server. Click [Add Features] button and then Click [Next]
button.
[8] Click [Next] button.
[9] Click [Next] button.
[10] Click [Install] button.
[11] After finishing Installation, click [Close] button.
DNS Server : Add Forward lookup Zone
Add Forward lookup Zone.
On CUI configuration, Run PowerShell with Admin Privilege and Configure like follows.
[1] For example, Add Forward lookup Zone with settings of Zone-Name [srv.world], Zone-File
[srv.world.dns].
Generally, set your domain name or portion of domain name for this Zone-Name.
Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.
PS C:\Users\Administrator> Add-DnsServerPrimaryZone -Name "srv.world" -ZoneFile "srv.world.dns" -
DynamicUpdate None -PassThru
ZoneName ZoneType IsAutoCreated IsDsIntegrated IsReverseLook
upZone IsSigned
-------- -------- ------------- -------------- -------------
------ --------
srv.world Primary False False False
False
PS C:\Users\Administrator> Get-DnsServerZone
# [srv.world] has been added
ZoneName ZoneType IsAutoCreated IsDsIntegrated IsReverseLook
upZone IsSigned
-------- -------- ------------- -------------- -------------
------ --------
0.in-addr.arpa Primary True False True
False
127.in-addr.arpa Primary True False True
False
255.in-addr.arpa Primary True False True
False
srv.world Primary False False False
False
TrustAnchors Primary False False False
False
# if remove it, run like follows
PS C:\Users\Administrator> Remove-DnsServerZone "srv.world" -PassThru
Confirm
[Y] Yes [N] No [S] Suspend [?] Help (default is "Y"): Y
ZoneName ZoneType IsAutoCreated IsDsIntegrated IsReverseLook
upZone IsSigned
-------- -------- ------------- -------------- -------------
------ --------
srv.world Primary False False False
False
DNS Server : Add Forward lookup Zone (GUI)
On GUI configuration, set like follows.
[2] Run Server Manager and select [Tools] - [DNS].
[3] Select own Hostname on the left pane and right-click the own Hostname to show menu on the left
pane, then select [New Zone...].
[4] Click [Next] button.
[5] Check a box [Primary zone] and click [Next] button.
[6] Check a box [Forward lookup Zone] and click [Next] button.
[7] Input Zone name. As the description on the screen-shot below, set domain name or portion of domain
name for this zone name.
[8] Set zone-file-name and click [Next] button. It's OK to keep default for zone-file-name.
[9] Click [Next] button with keeping default.
[10] Click [Finish] button.
[11] A new zone has been created under the Forward lookup Zone.
DNS Server : Add Reverse lookup Zone
Add Reverse lookup Zone.
On CUI configuration, Run PowerShell with Admin Privilege and Configure like follows.
[1] For example, Add Reverse lookup Zone with settings of network [10.0.0.0/24], Zone-File [0.0.10.in-
addr.arpa.dns].
Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.
PS C:\Users\Administrator> Add-DnsServerPrimaryZone -NetworkID 10.0.0.0/24 -ZoneFile "0.0.10.in-a
ddr.arpa.dns" -DynamicUpdate None -PassThru
ZoneName ZoneType IsAutoCreated IsDsIntegrated IsReverseLook
upZone IsSigned
-------- -------- ------------- -------------- -------------
------ --------
0.0.10.in-addr.arpa Primary False False True
False
PS C:\Users\Administrator> Get-DnsServerZone
# [0.0.10.in-addr.arpa] has beed added
ZoneName ZoneType IsAutoCreated IsDsIntegrated IsReverseLook
upZone IsSigned
-------- -------- ------------- -------------- -------------
------ --------
0.0.10.in-addr.arpa Primary False False True
False
0.in-addr.arpa Primary True False True
False
127.in-addr.arpa Primary True False True
False
255.in-addr.arpa Primary True False True
False
srv.world Primary False False False
False
TrustAnchors Primary False False False
False
# if remove it, run like follows
PS C:\Users\Administrator> Remove-DnsServerZone "0.0.10.in-addr.arpa" -PassThru
Confirm
[Y] Yes [N] No [S] Suspend [?] Help (default is "Y"): Y
ZoneName ZoneType IsAutoCreated IsDsIntegrated IsReverseLook
upZone IsSigned
-------- -------- ------------- -------------- -------------
------ --------
0.0.10.in-addr.arpa Primary False False True
False
DNS Server : Add Reverse lookup Zone (GUI)
On GUI configuration, set like follows.
[2] Run Server Manager and select [Tools] - [DNS].
[2] Select own Hostname on the left pane and right-click the own Hostname to show menu on the left
pane, then select [New Zone...].
[3] Click [Next] button.
[4] Check a box [Primary zone] and click [Next] button.
[5] Check a box [Reverse lookup Zone] and click [Next] button.
[6] On this example, configure IPv4 zone, Check a box [IPv4 Reverse lookup Zone] and click [Next]
button.
[7] Input [Network ID]. The example follows is for the case 10.0.0.0/24.
[8] Set zone-file-name and click [Next] button. It's OK to keep default for zone-file-name.
[9] Click [Next] button with keeping default.
[10] Click [Finish] button.
[11] A new zone has been added under the Reverse lookup Zone.
DNS Server : Add A/PTR record
Add A/PTR record.
On CUI configuration, Run PowerShell with Admin Privilege and Configure like follows.
[1] For example, Add A/PTR record with settings of hostname [rx-8], IP address [10.0.0.110] into a Zone
[srv.world].
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" -IPv4A
ddress "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 -Auto
Size -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
DNS Server : Add A/PTR record (GUI)
On GUI configuration, set like follows.
[2] Run Server Manager and select [Tools] - [DNS], next right-click the own domain name to show menu
on the left pane, then select [New Host(A or AAA)...].
[3] Input Hostname and IP address you'd like to add.
Furthermore, check a box [Create associated pointer (PTR) record].
[4] A new A/PTR record has beed just added.
DNS Server : Add CNAME record
Add CNAME record which is another name (Alias) of an A-record.
On CUI configuration, Run PowerShell with Admin Privilege and Configure like follows.
[1] For example, Add CNAME record [fd3s] to a Host [rx-7] in a Zone [srv.world].
Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.
PS C:\Users\Administrator> Add-DnsServerResourceRecordCName -Name "fd3s" -HostNameAlias "rx-7.sr
v.world" -ZoneName "srv.world" -PassThru
HostName RecordType Type Timestamp TimeToLive RecordData
-------- ---------- ---- --------- ---------- ----------
fd3s CNAME 5 0 01:00:00 rx-7.srv.wor
ld.
PS C:\Users\Administrator> Get-DnsServerResourceRecord -ZoneName "srv.world" | Format-Table -Auto
Size -Wrap
# CNAME record 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 [10][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.110
rx-8 MX 15 0 01:00:00 [10][rx-8.srv.world.]
# verify
PS C:\Users\Administrator> Resolve-DnsName fd3s.srv.world -Server localhost
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
# if remove it, run like follows
PS C:\Users\Administrator> Remove-DnsServerResourceRecord -ZoneName "srv.world" -RRType "CNAME" -
Name "fd3s" -PassThru
Confirm
[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.wor
ld.
DNS Server : Add CNAME record (GUI)
On GUI configuration, set like follows.
[2] Run Server Manager and select [Tools] - [DNS], next right-click the own domain name to show menu
on the left pane, then select [New Alias (CNAME)...].
[3] Input Alias name and FQDN, and also target Hostname like follows.
[4] A new CNAME record has beed just added.
DNS Server : Verify resolving
Verify resolving Hostname or IP address.
[1] Run PowerShell with Admin Privilege and make sure like follows.
Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.
# with nslookup command
# [nslookup (hostname to resolv) (server to ask)]
PS C:\Users\Administrator> nslookup rx-8.srv.world localhost
Server: UnKnown
Address: ::1
Name: rx-8.srv.world
Address: 10.0.0.110
PS C:\Users\Administrator> nslookup 10.0.0.110 localhost
Server: UnKnown
Address: ::1
Name: rx-8.srv.world
Address: 10.0.0.110
# with PowerShell Cmdlet
# Forward lookup
PS C:\Users\Administrator> Resolve-DnsName rx-8.srv.world -Type A -Server localhost
Name Type TTL Section IPAddress
---- ---- --- ------- ---------
rx-8.srv.world A 3600 Answer 10.0.0.110
# Reverse lookup
PS C:\Users\Administrator> Resolve-DnsName 10.0.0.110 -Type PTR -Server localhost
Name Type TTL Section NameHost
---- ---- --- ------- --------
110.0.0.10.in-addr.arpa PTR 3600 Answer rx-8.srv.world