Solved

Add DNS Suffix  with registry script

Posted on 2008-10-14
4
6,656 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

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

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

I wrote an article (http://www.experts-exchange.com/articles/2245/Anti-rootkit-software.html) some time ago with a reference to nLite  (http://www.nliteos.com/)slipstreaming software.  I recently changed that link to point to NTLite (https://www.ntl…
The article will include the best Data Recovery Tools along with their Features, Capabilities, and their Download Links. Hope you’ll enjoy it and will choose the one as required by you.
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…

726 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