Solved

Add DNS Suffix  with registry script

Posted on 2008-10-14
4
6,731 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 71

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 71

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

What Is Transaction Monitoring and who needs it?

Synthetic Transaction Monitoring that you need for the day to day, which ensures your business website keeps running optimally, and that there is no downtime to impact your customer experience.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A while back when OPSMGR 2012 was released we were very excited about getting it into our environment and upgrading our 2007 implementation,  we started our planning and we then proceeded with our implementation. All went as planned & our system …
I use more than 1 computer in my office for various reasons. Multiple keyboards and mice take up more than just extra space, they make working a little more complicated. Using one mouse and keyboard for all of my computers makes life easier. This co…
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…
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

717 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