Solved

"dns suffix for this connection" script problem

Posted on 2011-03-02
12
1,389 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
[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
  • 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
Ready to trade in that old firewall?

Whether you need to trade-up to a shiny new Firebox or just ready to upgrade from whatever appliance you're using now, WatchGuard has the right appliance for you! Find your perfect Firebox today with appliance sizing tool!

 

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

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

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

Not long ago I saw a question in the VB Script forum that I thought would not take much time. You can read that question (Question ID  (http://www.experts-exchange.com/Programming/Languages/Visual_Basic/VB_Script/Q_28455246.html)28455246) Here (http…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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…

617 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