Solved

"dns suffix for this connection" script problem

Posted on 2011-03-02
12
1,345 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
 

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
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
how to add columns to script to read the file. 25 41
If not exist vbs error 4 28
Parse DNS log 3 34
Public DNS 2 31
This is a little timesaver I have been using for setting up Microsoft Small Business Server (SBS) in the simplest possible way. It may not be appropriate for every customer. However, when you get a situation where the person who owns the server is i…
INTRODUCTION The purpose of this document is to demonstrate the Installation and configuration of the Data Protection Manager product. Note that this demonstration was prepared on the basis of Windows OS is 2008 R2 and DPM 2010. DATA PROTECTI…
Windows 8 comes with a dramatically different user interface known as Metro. Notably missing from the new interface is a Start button and Start Menu. Many users do not like it, much preferring the interface of earlier versions — Windows 7, Windows X…
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…

760 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

21 Experts available now in Live!

Get 1:1 Help Now