Windows 8.1 keeps losing manual DNS settings: Workaround?

martienne

New Member
Member
Messages
128
Location
European Union
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 Computer

System One

  • OS
    Win 8.1
    Computer type
    PC/Desktop
    CPU
    i5
    Motherboard
    ASUS
    Memory
    24 GB DDRAM3
    Graphics Card(s)
    NVIDIA GT430 x2
    Sound Card
    Audial
    Monitor(s) Displays
    2 x 28" Sharp
    Screen Resolution
    1360 x 768
    Hard Drives
    Samsung, Seagate, Toshiba, Hitachi, Western Digital
    PSU
    750 watt
    Cooling
    liquid closed

My Computer

System One

  • OS
    Windows 8.0 x64
    Computer type
    Laptop
    System Manufacturer/Model
    Toshiba Satelite C55D-A Laptop
    CPU
    AMD EI 1200
    Memory
    4 gb DDR3
    Graphics Card(s)
    Raedon 340 MB dedicated Ram
    Monitor(s) Displays
    Built in
    Screen Resolution
    1366 x 768
    Hard Drives
    640 GB (spinner) Sata II
    Keyboard
    Built in
    Mouse
    Touch pad
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 Computer

System One

  • OS
    Windows 8.1 Pro
    Computer type
    PC/Desktop
    System Manufacturer/Model
    Home Build
    CPU
    i7-4770K
    Motherboard
    ASUS Gryphon Z87
    Memory
    G.Skill Ripjaws 2x8GB
    Graphics Card(s)
    EVGA GTX 750 Ti 2GB
    Monitor(s) Displays
    24" Dells (2)
    Screen Resolution
    1920x1200
    Hard Drives
    Samsung 840 EVO, 240 GB SSD; WD Black 1TB
    PSU
    Seasonic 750W Gold
    Case
    Bitfenix Prodigy M - White
    Cooling
    NZXT Kracken 40
    Keyboard
    Logitech K800
    Mouse
    Logitech M310
    Internet Speed
    11Mbps
    Browser
    Chrome
    Antivirus
    MS Defender
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
dns.PNG
 

My Computer

System One

  • OS
    Windows 10 Pro + 8.1 pro and 7 Utimate
    Computer type
    PC/Desktop
    CPU
    i3 2.53GHz
It does sound like a program in the background is altering your DNS settings daily.
 

My Computer

System One

  • OS
    Windows 8 Pro
    Computer type
    PC/Desktop
    Memory
    6 GB
    Screen Resolution
    1280 x 1024
    Hard Drives
    12 TB in 6 disks
    PSU
    TX650
    Keyboard
    G15
    Mouse
    Intellimouse 3.0
    Internet Speed
    100 Mbits
    Browser
    Chrome
    Antivirus
    Trend Micro
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.

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:

My Computer

System One

  • OS
    Win 8.1
    Computer type
    PC/Desktop
    CPU
    i5
    Motherboard
    ASUS
    Memory
    24 GB DDRAM3
    Graphics Card(s)
    NVIDIA GT430 x2
    Sound Card
    Audial
    Monitor(s) Displays
    2 x 28" Sharp
    Screen Resolution
    1360 x 768
    Hard Drives
    Samsung, Seagate, Toshiba, Hitachi, Western Digital
    PSU
    750 watt
    Cooling
    liquid closed
QuickDNS also has command line interface for batch.

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

My Computer

System One

  • OS
    Windows 8.0 x64
    Computer type
    Laptop
    System Manufacturer/Model
    Toshiba Satelite C55D-A Laptop
    CPU
    AMD EI 1200
    Memory
    4 gb DDR3
    Graphics Card(s)
    Raedon 340 MB dedicated Ram
    Monitor(s) Displays
    Built in
    Screen Resolution
    1366 x 768
    Hard Drives
    640 GB (spinner) Sata II
    Keyboard
    Built in
    Mouse
    Touch pad
Just out of curiosity what is it changing your DNS to that might shed some light on what's doing it
 

My Computer

System One

  • OS
    Windows 10 Pro + 8.1 pro and 7 Utimate
    Computer type
    PC/Desktop
    CPU
    i3 2.53GHz
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 Computer

System One

  • OS
    Windows 8.0 x64
    Computer type
    Laptop
    System Manufacturer/Model
    Toshiba Satelite C55D-A Laptop
    CPU
    AMD EI 1200
    Memory
    4 gb DDR3
    Graphics Card(s)
    Raedon 340 MB dedicated Ram
    Monitor(s) Displays
    Built in
    Screen Resolution
    1366 x 768
    Hard Drives
    640 GB (spinner) Sata II
    Keyboard
    Built in
    Mouse
    Touch pad
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 Computer

System One

  • OS
    Win 8.1.1 Pro x64
    Computer type
    Laptop
    System Manufacturer/Model
    Lenovo E525
    CPU
    AMD A4-3300M @ 2,0GHz
    Memory
    6GB DDR3 1333MHz
    Graphics Card(s)
    AMD Radeon HD 6480G 512MB shared
    Sound Card
    Creative Sound Blaster X-Fi Surround 5.1
    Screen Resolution
    1366x768
    Hard Drives
    WD 465GB
    Cooling
    Fusion Tweaker
    Keyboard
    Logitech K360
    Mouse
    Logitech M705
    Internet Speed
    50/50 MBps
    Browser
    Yandex
    Antivirus
    No AV & No Firewall
    Other Info
    Headphones: Sennheiser RS170
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 thoughts exactly something like net nany or similar or even some ISP software that they insist you need but don't (just to squeeze a buck out you from adverting)
 

My Computer

System One

  • OS
    Windows 10 Pro + 8.1 pro and 7 Utimate
    Computer type
    PC/Desktop
    CPU
    i3 2.53GHz
Thanks everyone for your help and insights with this! :)
I really appreciate the support. I've got one step left to go in my "convenient and privacy oriented setup", on this machine. At long last, despite Windows and my ISP throwing plenty of obstacles in the path.

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?

It's called the Superhub, although it's not very super.....
The ISP I have here in the UK at the moment is one of the worst on the planet, I think.
They force customers to use their router, and the router doesn't allow changing of the DNS
They also censor hundreds of sites, simply refusing to resolve the names. Plenty of complaints about it in their forums, but no official response. People who complained about it had to teach the customer service what DNS is.... Additionally their DNS is slow. Tip to all in the UK; Stay CLEAR of this totally useless ISP which is in the pocket of Hollywood, NSA/GCHQ and Lord knows who else....! Why do Virgin suppress the ability to set the DNS ... - Help & Support Forum
I had no choice but to use them, according to what the porter in my building told me when I moved in.


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.

The Windows copy is off a CD, so it's nothing funny from a hardware vendor - I know such builds sometimes comes with lots of junk... But this is pure clean install.
I'm not using any anti-virus of any kind :) As an ex programmer I never got started using it (it really messes with a machine, and used to slow it down terribly) I have always managed my security in other ways (firewall, common sense, cloned backup system disk offline, User folder on D: and all the good old tricks). Please don't get side-tracked with that. I know that many consider it practically blasphemy to not use antivirus, but I just don't need it. I do a scan every now and then and never have any virus. I promise you it's safe, and lots of people who work in IT don't bother with antivirus. You mainly just get false positives, idiotic messages and it doesn't protect against brand new viruses. If you know how viruses and malware is caught, you can avoid exposure. I recently did a scan and the machine is clean. I also regularly run check HijackThis and CCcleaner. All clear there too.

I do have a third party VPN software installed which I have occassionally used. Maybe that resets the DNS?! Or maybe it somehow is re-set from the ISP. DCHP or something?! I am very sketchy of how the connectivity with them works. Networking is my blind spot with IT, I never really knew it.

Other than that I really don't know what....
 
Last edited:

My Computer

System One

  • OS
    Win 8.1
    Computer type
    PC/Desktop
    CPU
    i5
    Motherboard
    ASUS
    Memory
    24 GB DDRAM3
    Graphics Card(s)
    NVIDIA GT430 x2
    Sound Card
    Audial
    Monitor(s) Displays
    2 x 28" Sharp
    Screen Resolution
    1360 x 768
    Hard Drives
    Samsung, Seagate, Toshiba, Hitachi, Western Digital
    PSU
    750 watt
    Cooling
    liquid closed
We were not suggesting you had a virus or malware we were thinking it was some type of security or malware prevention program.
What does it reset your DNS too is my question if you open a command prompt and type or paste

Code:
nslookup


paste the results in your next post
 

My Computer

System One

  • OS
    Windows 10 Pro + 8.1 pro and 7 Utimate
    Computer type
    PC/Desktop
    CPU
    i3 2.53GHz
It used to reset it to auto-config of the DNS from the ISP.
Not anymore though, since I got that script working.
The results from nslookup will not reflect this problem, since I started using the workaround.
I also noticed in the connection log that a VPN I was using sometimes, resets DNS to the Google DNS servers.
I had not noticed them being in that setting, but clearly it's not unusual for various network related services to mess around with DNS. Also, I can see in my config that DCHP is running. I guess it might just be reset upon re-connection to the ISP or something.
I am way out of my depth with this, and I don't know what I could do about it, even if I found out what caused it.
 

My Computer

System One

  • OS
    Win 8.1
    Computer type
    PC/Desktop
    CPU
    i5
    Motherboard
    ASUS
    Memory
    24 GB DDRAM3
    Graphics Card(s)
    NVIDIA GT430 x2
    Sound Card
    Audial
    Monitor(s) Displays
    2 x 28" Sharp
    Screen Resolution
    1360 x 768
    Hard Drives
    Samsung, Seagate, Toshiba, Hitachi, Western Digital
    PSU
    750 watt
    Cooling
    liquid closed
Ah...the Virgin media Superhub...yes I use one of those...BUT....I have mine set to modem only....and then use my OWN router to do what I want with the routing/DNS lookups etc...
 

My Computer

System One

  • OS
    Windows 8 Pro
    Computer type
    PC/Desktop
    Memory
    6 GB
    Screen Resolution
    1280 x 1024
    Hard Drives
    12 TB in 6 disks
    PSU
    TX650
    Keyboard
    G15
    Mouse
    Intellimouse 3.0
    Internet Speed
    100 Mbits
    Browser
    Chrome
    Antivirus
    Trend Micro
Back
Top