Solved

"dns suffix for this connection" script problem

Posted on 2011-03-02
12
1,351 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
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 

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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

Over the years I have built up my own little library of code snippets that I refer to when programming or writing a script.  Many of these have come from the web or adaptations from snippets I find on the Web.  Periodically I add to them when I come…
It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
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…
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…

803 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