[ Team LiB ] |
Recipe 13.1 Creating a Forward Lookup Zone13.1.1 ProblemYou want to create a forward lookup zone. A forward lookup zone maps names to IP addresses or other names. 13.1.2 Solution13.1.2.1 Using a graphical user interface
13.1.2.2 Using a command-line interfaceThe following command creates an AD-Integrated zone: > dnscmd <DNSServerName> /zoneadd <ZoneName> /DsPrimary 13.1.2.3 Using VBScript' This code creates an AD-Integrated forward zone. ' ------ SCRIPT CONFIGURATION ------ strServer = "<DNSServerName>" ' e.g. dc1.rallencorp.com strNewZone = "<ZoneName>" ' e.g. othercorp.com ' ------ END CONFIGURATION --------- set objDNS = GetObject("winMgmts:\\" & strServer & "\root\MicrosoftDNS") set objDNSZone = objDNS.Get("MicrosoftDNS_Zone") strNull = objDNSZone.CreateZone(strNewZone, 0 , True) WScript.Echo "Created zone " & strNewZone 13.1.3 Discussion13.1.3.1 Using a command-line interfaceWhen you create an AD-integrated zone with the /DsPrimary switch, you can additionally include a /dp switch and specify an application partition to add the zone to. Here is an example: > dnscmd /zoneadd <ZoneName> /DsPrimary /dp domaindnszones.rallencorp.com 13.1.3.2 Using VBScriptThe DNS WMI Provider is Microsoft's first comprehensive DNS API. You can create and modify zones, query and manage resource records, and manipulate DNS server configuration. In the VBScript solution, the CreateZone method of the MicrosoftDNS_Zone class was used to create the forward zone. 13.1.4 See AlsoRecipe 13.2 for creating a reverse lookup zone, MS KB 323445 (HOW TO: Create a New Zone on a DNS Server in Windows Server 2003), MSDN: DNS WMI Provider, and MSDN: CreateZone Method of the MicrosoftDNS_Zone Class |
[ Team LiB ] |