Creating Resource Records using DNSCMD

If your DNS server is running Windows Server Core, you can create resource records from the command-line by using the DNSCMD command. For example, to create a host (A) record in the fabrikam.com on authoritative DNS server SEA-SC1 for a server named SEA-SRV8 that has IP address 172.16.11.75, do the following:

dnscmd SEA-SC1 /recordadd fabrikam.com SEA-SRV8.fabrikam.com. /aging /openacl A 172.16.11.75

Verify the result by listing all A records in the domain as follows:

dnscmd SEA-SC1 /enumrecords fabrikam.com fabrikam.com. /type A

Returned records:

@ [Aging:3571189] 600 A 172.16.11.30

SEA-DESK155 [Aging:3571191] 1200 A      172.16.11.80

sea-sc1 [Aging:3571238] 3600 A  172.16.11.30

SEA-SC4 [Aging:3571189] 1200 A  172.16.11.33

SEA-SRV4 [Aging:3571192] 1200 A 172.16.11.81

SEA-SRV8 [Aging:3571246] 3600 A 172.16.11.75

The /aging switch in the previous command indicates that the new resource record can be aged and scavenged. If you omit this parameter, the
resource record remains in the DNS database until it is updated or removed manually. The /openacl switch indicates that any user can modify this
record. Without this parameter, only administrators can modify the record.

For more information on managing DNS servers running on Windows Server Core, see my book Windows Server 2008 Server Core Administrator's Pocket Consultant from Microsoft Press.

About The Author

Leave a Comment

Your email address will not be published. Required fields are marked *

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Scroll to Top