Wednesday, January 21, 2009

Add DNS suffix search list through command prompt

There are many ways to enable DNS suffix search list group policy in a DNS Client. One method is to create DNS suffix search list is through registry key "SearchList".

1. Assume the DNS suffixes to be added are "myrootdns1.com" and "myrootdns.com". Then the following command adds DNS suffix search list registry key "SearchList" through command prompt.

reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows NT\DNSClient" /v searchlist /t REG_MULTI_SZ /d myrootdns1.com, myrootdns.com /f




To check the Suffix SearchList working or not do the following
1. Assume the target machine name to which the dns suffix search list is "dnsserver"
2. Run the following command to query the name "dnsserver".
nslookup dnsserver



You can verify order of dns queries for the name "dnsserver" by looking in to the dns.log log file located at %systemroot%\system32\dns\dns.log (generally at C:\windows\system32\dns\dns.log) at "dnsserver" host.

Set of suffix search list items to be added is unlimited. It is not possible to update, edit or modify the existing Suffix Search list through command prompt. However, you can change or overwrite the existing suffix search list with the new one.

1 comment: