0% found this document useful (0 votes)
54 views4 pages

Examples of Network Administration Tasks: Previous One

This document provides an excerpt from a book about using PowerShell to manage Windows Server 2012. It discusses how PowerShell can be used to perform common DNS server management tasks like creating resource records, configuring forwarders, and displaying the DNS cache. It also provides an exercise on configuring a caching-only DNS server using PowerShell by installing the DNS server role, configuring root hints, clearing the cache, and adding another server as a forwarder to improve name resolution performance.

Uploaded by

Ramesh Murali
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
54 views4 pages

Examples of Network Administration Tasks: Previous One

This document provides an excerpt from a book about using PowerShell to manage Windows Server 2012. It discusses how PowerShell can be used to perform common DNS server management tasks like creating resource records, configuring forwarders, and displaying the DNS cache. It also provides an exercise on configuring a caching-only DNS server using PowerShell by installing the DNS server role, configuring root hints, clearing the cache, and adding another server as a forwarder to improve name resolution performance.

Uploaded by

Ramesh Murali
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 4

Much of my new book is focused on using PowerShell to manage Windows Server 2012, so this article and the previous

one include some short e cerpts from my book to both whet your appetite !to entice you into buying my book" and to show you some of the things you can do as an admin using PowerShell# $ote that the target audience of the book is Windows intermediate% level admins who have several years of work e perience but who might still be beginners when it comes to using PowerShell, so &'m hoping that readers will find my book useful to learn how they can start using PowerShell to simplify and automate the administration of Windows servers in their environment# (his second e cerpt is from )hapter * $etwork +dministration and shows how you can manage Windows Server 2012 ,$S servers using PowerShell# &'ve also included one of the chapter's e ercises, which shows how you can configure a caching%only ,$S server using PowerShell# $ote that these book e cerpts haven't finished going through the editorial review process yet, so they may change a bit in the published version#

Examples of network administration tasks


(he best way to learn how to use Windows PowerShell to administer network settings and services on Windows Server 2012 is to e periment with performing different tasks in a test environment# (he following sections provide some e amples of what you can do in this area, and the practice and suggested practice e ercises included in this chapter present you with further challenges for learning these skills###

Creating DNS resource records


-ou can manage Windows Server 2012 ,$S servers using Windows PowerShell# )ommon ,$S server management tasks adding resource records to .ones, configuring forewarders, configuring root hints, and so on# /or e ample, let's view a list of .ones on a ,$S server that is also a domain controller for the corp#contoso#com domain0
PS C:\> Get-DnsServerZone ZoneName ZoneType IsAutoCreated IsDsIntegrated IsReverseLoo upZone IsS!gned --------------------------- -------------------------------- -------"msd#s$#orp$#ontoso$#om Pr!mary %a&se True %a&se True '$!n-addr$arpa Pr!mary True %a&se True ()*$!n-addr$arpa Pr!mary True %a&se True )++$!n-addr$arpa Pr!mary True %a&se True #orp$#ontoso$#om Pr!mary %a&se True %a&se TrustAn#,ors Pr!mary %a&se True %a&se

%a&se %a&se %a&se %a&se %a&se

(o view a list of resource records of type + !address" in the corp#contoso#com .one, we can pipe the output of the 1et%,nsServer2esource2ecord cmdlet into the Where%3b4ect cmdlet like this0

PS C:\> Get-DnsServerResour#eRe#ord -ZoneName #orp$#ontoso$#om - .,ere-/01e#t 23"$Re#ordType -e4 5A56 7ostName -------8 A 8 A Doma!nDnsZones Doma!nDnsZones %orestDnsZones %orestDnsZones sea-srv-( S>A-SR?-+ Re#ordType T!mestamp T!meToL!ve Re#ordData ---------- --------------------------*9:9)'() ():'':'' P; '':(':'' (*)$(<$(($=< *9:9)'() (:'':'' P; '':(':'' (*)$(<$(($)=) A *9:9)'() ():'':'' P; '':(':'' (*)$(<$(($=< A *9:9)'() ():'':'' P; '':(':'' (*)$(<$(($)=) A *9:9)'() ():'':'' P; '':(':'' (*)$(<$(($=< A *9:9)'() ():'':'' P; '':(':'' (*)$(<$(($)=) A ' '(:'':'' (*)$(<$(($)=) A ' '(:'':'' (*)$(<$(($=<

(o add a new + resource record for a test server, you can use the +dd% ,nsServer2esource2ecord+ cmdlet like this0 PS )056 +dd%,nsServer2esource2ecord+ %&Pv7+ddress 182#1*#11#29: %$ame S;+%(;S( %<one$ame corp#contoso#com -ou can also add other types of resource records such as P(2, )$ or M= records using the above cmdlet# +nd you can use the 2emove%,nsServer2esource2ecord cmdlet to remove resource records from a .one# (here are over one hundred different cmdlets in the ,nsServer module for Windows PowerShell in Windows Server 2012# (able 1 shows the cmdlets you can use to perform some common ,$S administration tasks# -ou'll get some hands%on e perience with using some of these cmdlets in the practice e ercises for this chapter# TASK )onfigure forwarders )reate a stub .one ,isplay the contents of the ,$S server cache )lear the ,$S server cache ,isplay full configuration details of the ,$S server ,isplay statistics for the ,$S server &mport root hints )onfigure the ,$S server cache settings )onfigure ,$S server scavenging &nitiate scavenging CMDLET +dd%,nsServer/orwarder +dd%,nsServerStub<one Show%,nsServer)ache )lear%,nsServer)ache 1et%,nsServer 1et%,nsServerStatistics &mport%,nsServer2oot>int Set%,nsServer)ache Set%,nsServerScavenging Start%,nsServerScavenging

Table ! Some common ,$S server administration tasks and the Windows PowerShell cmdlets you can use to perform them#

Configuring a cac"ing#onl$ DNS ser%er using &indows 'owerS"ellExercise (!


&n this e ercise you will configure a caching%only ,$S server using Windows PowerShell# -ou will then configure a forwarder on your caching%only ,$S server to improve its name resolution performance# 1# ?og on to S;2@;21, open Server Manager, select the +ll Servers page and make sure that both servers are displayed in the Servers tile# &f S;2@;22 is not displayed, add it to the server pool# 2# 3pen a Windows PowerShell prompt and run the following command to install the ,$S Server role on S;2@;220 &nstall%Windows/eature %$ame ,>)P )omputer$ame S;2@;22 %&ncludeManagement(ools %2estart $ote that although you specified the %2estart parameter, the servers did not restart after role installation because a restart was determined as being unnecessary# 9# S;2@;2A is now configured as a caching%only ,$S server is not authoritative for any domains and can only perform, Bueries, cache the answers, and return the results# )aching%only ,$S servers can be useful at locations such as branch office sites and use root hints to identify the authoritative ,$S servers for the root .one of your organi.ation's ,$S namespace# 7# S;2@;2A is currently using root hints for recursively performing name resolution# (o view the root hints configured on S;2@;22, run the following command0 1et%,nsServer2oot>int %)omputer$ame S;2@;22 A# ,isplay the contents of the ,$S server cache on S;2@;22 by running the following command0 Show%,nsServer)ache %)omputer$ame S;2@;22 *# Cse the nslookup command%line utility to attempt to use S;2@;22 for resolving the &P address for the fully%Bualified domain name !/D,$" www#bing#com as follows0 nslookup www#bing#com S;2@;22 8# $ote that one or more ,$S server time outs may occur when you perform this name Buery# (his is because name resolution is being performed recursively, beginning with the root name servers on the &nternet, which can take several seconds to complete# &f no response is received to your Buery, repeat running the above command until a non% authoritative response is received#

E# Cse the command Show%,nsServer)ache %)omputer$ame S;2@;22 and note that the ,$S server cache now contains numerous entries relating to the name Buery you performed using nslookup# :# )lear the ,$S server cache on S;2@;22 by running the following command0 )lear%,nsServer)ache %)omputer$ame S;2@;22 10# ,isplay the contents of the ,$S server cache on S;2@;22 again by running this command0 Show%,nsServer)ache %)omputer$ame S;2@;22 11# $ote that the cache entries relating to the name Buery you performed using nslookup have now been deleted# (he only entries that remain in the cache are those for the root hints configured on the server# 12# (o speed up name resolution on your caching%only name server, you will configure S;2@;21 as a forwarder on S;2@;22# 3nce you have done this, any name Buery sent to S;2@;22 will be forwarded to S;2@;21 which will then use its e ternal forwarders at your &nternet Service Provider !&SP" for resolving the Buery# 19# )onfigure S;2@;21 as a forwarder on S;2@;22 by running the following command0 +dd%,nsServer/orwarder %&P+ddress 10#10#0#1 %)omputer$ame S;2@;22 17# @erify the result by displaying the forwarders configured on S;2@;22 as follows0 1et%,nsServer/orwarder %)omputer$ame S;2@;22 1A# Cse nslookup to perform another name Buery against S;2@;22 for the /D,$ www#bing#com# (he response should be received almost immediately with no ,$S server time outs occurring# (his is because the Buery was forwarded to S;2@;21 which then forwarded it to your &SP's ,$S servers for resolution# (his approach is generally much faster than using the &nternet root name servers to reclusively resolve the reBuested /D,$# 1*# ,isplay the contents of the ,$S server cache on S;2@;22 again# $ote the cache entries relating to your name Buery, and note also that there are considerably fewer cache entries than when root hints alone were used for performing recursive name resolution#

Co

You might also like