Windows 8 and 8.1 Forums


Windows 8.1 keeps losing manual DNS settings: Workaround?

  1. #1

    Windows 8.1 keeps losing manual DNS settings: Workaround?


    I want to use third party DNS servers rather than those of my ISP.
    However, it takes less than a day for Windows 8 to lose the settings I painstakingly entered (awkward user interface, and long navigation to enter manually).

    Can I set the DNS servers using a script, and if so how do I go about this?

      My System SpecsSystem Spec

  2. #2


    Posts : 2,130
    Windows 8.0 x64
      My System SpecsSystem Spec

  3. #3


    Posts : 42
    Windows 8.1 Pro


    It's usually very easy to enter alternative DNS sources in your router rather than in the OS. But, of course, there are reasons to do it in the OS; for example, if you don't want other devices on your wireless network to use the alternate DNSs.
      My System SpecsSystem Spec

  4. #4


    Posts : 115
    Windows 10 Pro + 8.1 pro and 7 Utimate


    Whenever I change my DNS settings it stays that way until I change them again, Maybe some program is changing them after you do it
    Click image for larger version
      My System SpecsSystem Spec

  5. #5


    Posts : 467
    Windows 8 Pro


    It does sound like a program in the background is altering your DNS settings daily.
      My System SpecsSystem Spec

  6. #6


    Quote Originally Posted by rchris View Post
    It's usually very easy to enter alternative DNS sources in your router rather than in the OS. But, of course, there are reasons to do it in the OS; for example, if you don't want other devices on your wireless network to use the alternate DNSs.
    Thanks, that's good advice! However, my router (provided by my ISP) doesn't seem to have that setting.

    Quote Originally Posted by Wullail View Post
    It does sound like a program in the background is altering your DNS settings daily.
    The thought appeared to me, but I don't know what program, when or why, and I have no idea how to find that out. Probably, it's unavoidable, in that case. Additionally, lots of people are complaining about this online, so it's possible that it's just something in Windows 8.

    For me, the best solution was a workaround.
    Here is how I "think" I have solved this, after spending a couple of hours digging around.


    1) Create a bat script to set your DNS servers (the syntax was rather confusing and poorly documented, but I got it, at last)

    Code:
    REM Sets the primary DNS server for the Ethernet connection (LAN cable to modem)
    netsh interface ip set dns name="Ethernet" source=static addr= x.xx.xx.xxx register=none
    
    REM Sets the backup DNS server for the Ethernet connection 
    netsh interface ip add dnsservers "Ethernet" xx.xx.xx.xx index=2
    
    REM Set the primary DNS server for the VPN
    netsh interface ip set dns name="VPN _Connection_Name" source=static addr=xx.xx.xx.xx register=none
    
    REM Set the backup DNS server for the VPN
    netsh interface ip add dnsservers "VPN _Connection_Name" xx.xx.xx.xx index=2
    Note: You would have to add things like Wireless connection if you are using that. My setup are for the conditions on my desktop PC. There is no visible error message if the commands fail (unless you pause the bat file), so you need to verify that you have the correct name for your connections. The names of the connections are case sensitive.

    2) Save the file with the extension bat, in a convenient location on your machine, for example the Windows folder.
    3) Create a shortcut to the bat file and enter Advanced settings to say that it should run as Administrator (otherwise it doesn't execute).
    4) Place the bat file in your Startup folder. This takes care of the risk that the settings are lost at reboot.
    5) You may also want to set up a Scheduled task to run the script every 6 hours the computer is on, or something like that. Just in case the settings are reset by some application or other source for whatever reason.

    This works....
    Last edited by martienne; 14 Jun 2014 at 07:00.
      My System SpecsSystem Spec

  7. #7


    Posts : 2,130
    Windows 8.0 x64


    QuickDNS also has command line interface for batch.

    My experience with anything NirSoft I've tried has been positive over the years.
      My System SpecsSystem Spec

  8. #8


    Posts : 115
    Windows 10 Pro + 8.1 pro and 7 Utimate


    Just out of curiosity what is it changing your DNS to that might shed some light on what's doing it
      My System SpecsSystem Spec

  9. #9


    Posts : 2,130
    Windows 8.0 x64


    Quote Originally Posted by sml156 View Post
    Just out of curiosity what is it changing your DNS to that might shed some light on what's doing it
    I wonder if it could be some anti-malware that resets dns, hosts, home pages etc.?

    Or something that uses Shadow Copy Service? When you reboot changes evaporate.
      My System SpecsSystem Spec

  10. #10


    Trnava
    Posts : 683
    Win 8.1.1 Pro x64


    Quote Originally Posted by martienne View Post
    However, my router (provided by my ISP) doesn't seem to have that setting.
    That is a basic setting for any router, it is probably well hidden, what kind of a router do you have?
      My System SpecsSystem Spec

Page 1 of 2 12 LastLast
Windows 8.1 keeps losing manual DNS settings: Workaround?
Related Threads
Greetings - sorry for the crammed title. Basically I have 2 disks - OS on the first one, and everything else on the disk #2. Disk 2 (an HDD) is currently partitioned under GUID - and one of the partitions is my drive D:, where all of my programs, libraries, cache files and whatnot else are stored....
So Microsoft is soooo stupid. Anyways, I just bought Windows 8 from their website so that I can upgrade my current system from Windows 7 32 bit to Windows 8 64 bit. Turns out, if you are currently running 32 bit, you can't download the 64 bit version of Windows. So basically I need a...
I am using IE 11 desktop. In Settings/Internet Options/General I entered an address to be used as my home page by clicking 'Use Current'. I also selected 'Start with Home Page', applied the settings and Ok'ed. On the Home Page icon on the toolbar I elected to 'Use this page as your only...
Solved Windows Defender manual update in System Security
Initially on Win7, I was manually updating Security Essentials when was offline from this link: How to manually download the latest definition updates for Microsoft Security Essentials You choose x86 or x64 and go from there. What's not mentioned, is that you can use the same links to...
Since I've had the common problem of Windows 8 Updates hanging at around the 12% figure on my new Laptop, I have resorted to Manual Updating which has been successful. Once the Update is downloaded, then you're invited to restart to install the Update, but if you don't do this then the Update...
Hi, I just wanted to say that my biggest annoyance with Windows 8 is that there is no X out button to close applications that I open, they continue to run in the background and appear in the left side of screen menu. As a very long time PC user, I've always closed my applications when I'm...
Solved Windows 8 Manual ? in General Support
Hello All :) Is there a manual or some place were I can go to were I can learn how to use Win 8 Thanks
Eight Forums Android App Eight Forums IOS App Follow us on Facebook