Solved

Add DNS Suffix  with registry script

Posted on 2008-10-14
4
6,539 Views
Last Modified: 2013-11-30
I want to modify the dns search list in the registry on a 100 plus vista enterprise machine.

I know it is in HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters

Does any one have a script I could double click and merge to the registry?
The users of these machines are all technically inclined and it will be a case of placing the file on a network share they could all click and add to their machines.

Something along the lines of

Mydomain.domain.co.uk
Otherdomain.thatdomain.com
Thisdomain.iwant.local

Any help will be greatly appreciated

Thanks
DB
0
Comment
Question by:doragbon
  • 2
4 Comments
 
LVL 6

Accepted Solution

by:
tchamtieh earned 250 total points
ID: 22716029
Try this script.

-Thomas
' This code will change the DNS suffix search order

' to "mycompany.com" followed by "east.mycompany.com"

' ------ SCRIPT CONFIGURATION ------

strComputer = "."

arrNewDNSSuffixOrder = Array("mycompany.com", "east.mycompany.com")

' --------- END CONFIGURATION ------
 

Set objWMIService = GetObject("winmgmts:" _

 & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")

Set nics = objWMIService.ExecQuery _

 ("SELECT * FROM Win32_NetworkAdapterConfiguration WHERE IPEnabled = True")
 

Set Network = objWMIService.Get("Win32_NetworkAdapterConfiguration")
 

' now set the new DNS suffix search order

SetSuffixes = _

  Network.SetDNSSuffixSearchOrder(arrNewDNSSuffixOrder)
 

If SetSuffixes = 0 Then

  WScript.Echo "Success! Replaced DNS domain suffix search order."

ElseIf SetSuffixes = 1 Then

  WScript.Echo "Success! Replaced DNS domain suffix search order. Please reboot."

Else

  WScript.Echo "Error! Unable to replace DNS domain suffix search order list."

End If

Open in new window

0
 
LVL 70

Assisted Solution

by:Chris Dent
Chris Dent earned 250 total points
ID: 22716154

DB you know you can set this with Group Policy, right? Or are you wanting to add entries onto an existing list?

Chris
0
 

Author Comment

by:doragbon
ID: 22716331
Chris,

I have a 2000 SP4 AD where do you think I could start.

Step by step instructions will be helpful these migration process is getting the better of me .Is there an adm file you have or something really straight forward.

Lots of thanks
DB
0
 
LVL 70

Expert Comment

by:Chris Dent
ID: 22716410

The policy can only be applied to XP and above, but that shouldn't mean we can't run it on your current domain, you just need to get the template on there.

The policy we'd be looking at is built into both Vista and XP. If you could install the Group Policy Management Console onto an XP system (or 2003 server) you should be able to set it and it will upload the necessary templates to your DCs.

It hides under:

Computer Configuration / Administrative Templates / Network / DNS Client

You would add the suffixes as a comma delimited list into the "DNS Suffix Search List" policy.

Chris
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

I will assume you are running a non-server version of some sort of Windows throughout this article. There are many flavors of Windows since Windows Server 2000 - 2008, XP Home & Pro, Vista Home & Pro, and Windows 7 Starter, Home, Pro, Ultimate, etc.…
One of the most often confused topics in the area DNS is the idea of GLUE records. Specifically, what they are, when they are needed, when they are provided, and how they are created. First, WHAT IS GLUE? To understand GLUE, you must first under…
The Task Scheduler is a powerful tool that is built into Windows. It allows you to schedule tasks (actions) on a recurring basis, such as hourly, daily, weekly, monthly, at log on, at startup, on idle, etc. This video Micro Tutorial is a brief intro…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now