Recipe 13.1 Creating a Forward Lookup Zone

13.1.1 Problem

You want to create a forward lookup zone. A forward lookup zone maps names to IP addresses or other names.

13.1.2 Solution

13.1.2.1 Using a graphical user interface
  1. Open the DNS Management snap-in.

  2. If an entry for the DNS server you want to connect to does not exist, right-click on DNS in the left pane and select Connect to DNS Server. Select This computer or The following computer, enter the server you want to connect to (if applicable), and click OK.

  3. Expand the server in the left pane and click on Forward Lookup Zones.

  4. Right-click on Forward Lookup Zones and select New Zone.

  5. Click Next.

  6. Select the zone type and click Next.

  7. If you selected to store the zone data in Active Directory, next you will be asked which servers you want to replicate the DNS data to. Click Next after you make your selection. (This only applies for Windows Server 2003).

  8. Enter the zone name and click Next.

  9. Fill out the information for the remaining screens. They will vary depending on if you are creating a primary, secondary, or stub zone.

13.1.2.2 Using a command-line interface

The 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 Discussion

13.1.3.1 Using a command-line interface

When 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 VBScript

The 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 Also

Recipe 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



Active Directory Cookbook
Active Directory Cookbook, 3rd Edition
ISBN: 0596521103
EAN: 2147483647
Year: 2006
Pages: 456

Similar book on Amazon

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net