Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

"dns suffix for this connection" script problem

Posted on 2011-03-02
12
Medium Priority
?
1,422 Views
Last Modified: 2012-05-11
Hello,

I have a script that changes the "dns suffix for this connection" setting that is partially working.

Here is what is happening:
If the current value is foobar.com and I set  StrDNSDomain ="newvalue.com" for this command
objItem.SetDNSDomain(StrDNSDomain)

ipconfig /all and the GUI  DNS network properties show newvalue.com.

If I then change StrDNSDomain ="" (clearing out the "dns suffix for this connection" value),
ipconfig /all reverts back foobar.com BUT the GUI DNS is blank.

This will happen regardless of the number of times I set the connection property.  For example I can run the script with a value of foobar1.com, then  foobar2.com,  then foobar3.com and after each pass ipconfig /all and the GUI show the value.  

As soon as I try to clear out the value (which is my goal for this script), the property reverts back to the original setting.  I have tried to reboot the system as well and that has not done anything.    Any ideas?
0
Comment
Question by:mcalo1
  • 6
  • 3
  • 3
12 Comments
 
LVL 4

Expert Comment

by:EshuunDara
ID: 35019416
The DNS Suffix is typically controlled by your domain.  If you're in a domain environment, you should be changing this value using group policy, not a script, which may be the source of your problem.
0
 
LVL 4

Expert Comment

by:EshuunDara
ID: 35019469
Also, if you're using DHCP, your DHCP server can set your DNS suffix.  You might be able to change it there as well.
0
 
LVL 4

Expert Comment

by:EshuunDara
ID: 35019512
Finally, you can also edit the registry.  Your DNS info is stored here:

HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Paramaters

And you'll want to change these entries:
Domain (REG_SZ)
SearchList (REG_SZ)

0
 The Evil-ution of Network Security Threats

What are the hacks that forever changed the security industry? To answer that question, we created an exciting new eBook that takes you on a trip through hacking history. It explores the top hacks from the 80s to 2010s, why they mattered, and how the security industry responded.

 

Author Comment

by:mcalo1
ID: 35020442
I am looking to change  the specific network connection  dns suffix, not the machine one.  There are some domain and non domain machines that need this setting, so a GPO will not cover all the machines.

The script does work in changing the suffix for network connections, but just not when it is blank. This is what I need to get working.  

0
 
LVL 65

Expert Comment

by:RobSampson
ID: 35023061
Hi, have you tried
objItem.SetDNSDomain(Null)

Or
objItem.SetDNSDomain(vbNullString)

Rob.
0
 

Accepted Solution

by:
mcalo1 earned 0 total points
ID: 35031445
That did not work either.  I think it is a machine specific issue.

Thanks for the suggestions however.
0
 

Author Comment

by:mcalo1
ID: 35031570
The issue resided on some of the target machines.
0
 
LVL 65

Expert Comment

by:RobSampson
ID: 35031796
What *was* the issue?  Did you reimage the machines?

Rob.
0
 

Author Comment

by:mcalo1
ID: 35031879
We reimaged a couple of machines and it worked on them.  I am guessing it was something to do with specific hot fixes/applications/etc on the machine.  The most cost effective thing to do was to cut bait and have our intern manually change the settings on the problematic machines.

Thanks
0
 
LVL 65

Expert Comment

by:RobSampson
ID: 35032044
Fair enough. Thanks for the info.

Rob.
0
 

Author Comment

by:mcalo1
ID: 35035963
Closing this.
0
 

Author Closing Comment

by:mcalo1
ID: 35067767
It was a machine specific issue
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

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

There have been a lot of times when we have seen the need to enter a large number of DNS entries in a forward lookup zone. The standard procedure would be to launch the DNS Manager console, create the Zone and start adding new hosts using the New…
This article is the result of a quest to better understand Task Scheduler 2.0 and all the newer objects available in vbscript in this version over  the limited options we had scripting in Task Scheduler 1.0.  As I started my journey of knowledge I f…
This video Micro Tutorial explains how to clone a hard drive using a commercial software product for Windows systems called Casper from Future Systems Solutions (FSS). Cloning makes an exact, complete copy of one hard disk drive (HDD) onto another d…
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…

824 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