local as a primary zone, you can
run this command:
Dnscmd /zoneadd "testlab.local" /Primary /file "testlab.local.dns"
Now if you want to add an A record for a host called testpc with the IP address
192.168.100.71 to the testlab.local zone, you??™d enter this:
Dnscmd /recordadd testlab.local testpc A 192.168.100.71
39 Chapter 2: Server Core
The /recordadd switch can be used to add any record type you want to the DNS
Server. You would simply replace the A before the IP address with whatever record
type you wanted??”for example, CNAME or MX followed by the parameters required by
that record type. Run this command to see a list of available record types and their
parameters:
Dnscmd /recordadd /?
If you want to view all the records of a particular zone, use the /zoneprint switch.
For example, to list all the entries of your testlab.local zone, you would run this:
Dnscmd /zoneprint testlab.local
If you want to delete a record, you would run dnscmd with the /recorddelete
switch. To delete the A record entry for the testpc record created earlier, you??™d run this
command:
Dnscmd /recordadd testlab.local testpc A 192.168.100.71 /f
The /f switch at the end indicates that you want to force the deletion of this record;
otherwise, dnscmd will politely ask for confirmation before deleting the record.
There??™s more to DNS than what you??™ve learned so far, especially the new features of
DNS in Windows Server 2008, which are covered in Chapter 10.
Pages:
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80