Solved

"dns suffix for this connection" script problem

Posted on 2011-03-02
12
1,346 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
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 

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

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

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

BIND is the most widely used Name Server. A Name Server is the one that translates a site name to it's IP address. There is a new bug in BIND (https://kb.isc.org/article/AA-01272), affecting all versions of BIND 9 from BIND 9.1.0 (inclusive) thro…
Citrix XenApp, Internet Explorer 11 set to Enterprise Mode and using central hosted sites.xml file.
In this video, we discuss why the need for additional vertical screen space has become more important in recent years, namely, due to the transition in the marketplace of 4x3 computer screens to 16x9 and 16x10 screens (so-called widescreen format). …
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…

929 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

8 Experts available now in Live!

Get 1:1 Help Now