Windows 10: command to remove DNS entries in Advanced Settings?

Discus and support command to remove DNS entries in Advanced Settings? in Windows 10 Network and Sharing to solve the problem; Hi All Wondering if anyone knows a command to remove the DNS entries within the advanced TCP/IP settings? The primary and secondary DNS IP need... Discussion in 'Windows 10 Network and Sharing' started by rman91, Mar 12, 2018.

  1. rman91 Win User

    command to remove DNS entries in Advanced Settings?


    Hi All

    Wondering if anyone knows a command to remove the DNS entries within the advanced TCP/IP settings?

    The primary and secondary DNS IP need to be changed with the tertiary and quaternary DNS IP. Simple enough doing it manually but there's over 50 VMs this needs to be done on so i'm trying to write a script for this.

    i did try to the below command but as the IPs are already added it wouldn't re-arrange them into the given order

    e.g. (IPs have been randomised)

    netsh dnsclient add dnsserver "Local Area Connection" 10.91.201.56 1

    netsh dnsclient add dnsserver "Local Area Connection" 10.91.201.57 2

    netsh dnsclient add dnsserver "Local Area Connection" 10.91.207.55 3

    netsh dnsclient add dnsserver "Local Area Connection" 10.91.207.54 4

    Any help is greatly appreciated - thanks

    :)
     
    rman91, Mar 12, 2018
    #1

  2. Can't join room, Error: "Can't connect", Xbox subscription, Music Pass, Microsoft account??

    Mike,

    I'm in the same situation - what DNS entries did you remove, or better yet could you point me to your current set of DNS entries.
     
    Hellman101, Mar 12, 2018
    #2
  3. Windows Media Creation Tool error 0x80072F76-0x20017

    The solution to me was to fall back to my ISP's DNS. The tool was not working on Google's DNS (8.8.8.8). I simply removed the custom DNS entry from my router and it was fixed...

    If you haven't ever set your DNS manually then the solution might be to find another DNS service that does happen to work. My ISP's happens to work for me.
     
    nineclicks, Mar 12, 2018
    #3
  4. f14tomcat Win User

    command to remove DNS entries in Advanced Settings?

    Just a S.W.A.G really, but if you combine deletion and addition in the same .bat, it may work. Delete them all, then add in the order you want, one line each.


    netsh dnsclient delete dnsserver "Local Area Connection" all

    netsh dnsclient add dnsserver "Local Area Connection" 10.91.201.56 1

    netsh dnsclient add dnsserver "Local Area Connection" 10.91.201.57 2

    netsh dnsclient add dnsserver "Local Area Connection" 10.91.207.55 3

    netsh dnsclient add dnsserver "Local Area Connection" 10.91.207.54 4
     
    f14tomcat, Mar 12, 2018
    #4
  5. EdTittel Win User
    I agree with F14Tomcat, because the only way to control ordering is to provide the entries in the order you want. By removing all previous entries, you "make room" to add replacements in the desired order. If, for some odd reason or another, that doesn't work, you may want to look into using an automation tool like AutoHotkey instead to capture the sequence of GUI commands for removing and adding those entries instead. For what I hope are obvious reasons, the batch file is the preferred alternative.
    HTH,
    --Ed--
     
    EdTittel, Mar 12, 2018
    #5
  6. rman91 Win User
    thanks very much for the replies - will give this ago and let you know!

    cheers
     
    rman91, Mar 12, 2018
    #6
  7. rman91 Win User
    @f14tomcat @EdTittel

    FYI - with a little more looking around i've managed to find something that works. Thanks for your help!

    netsh dnsclient delete dnsserver "Local Area Connection" allnetsh interface ip set dns name="Local Area Connection" static 10.91.201.56netsh interface ip add dns name="Local Area Connection" 10.91.201.57 index=2netsh interface ip add dns name="Local Area Connection" 10.91.201.55 index=3netsh interface ip add dns name="Local Area Connection" 10.91.201.54 index=4
     
    rman91, Mar 12, 2018
    #7
  8. EdTittel Win User

    command to remove DNS entries in Advanced Settings?

    Good work. The text got all jammed together, but with my "parsing hat" on I think I see what you did. Good work. Now, you can try it as a script on one or two test machines. If that works, then it works, too.
    Persistence pays off once again!
    --Ed--
     
    EdTittel, Mar 12, 2018
    #8
  9. f14tomcat Win User
    Very slick! Good job! Glad to see you got it!! *Thumbs
     
    f14tomcat, Apr 5, 2018
    #9
Thema:

command to remove DNS entries in Advanced Settings?

Loading...
  1. command to remove DNS entries in Advanced Settings? - Similar Threads - command remove DNS

  2. No Command Prompt in Advanced Startup

    in Windows 10 Software and Apps
    No Command Prompt in Advanced Startup: Hi, I tried to recover my password in advanced startup on my HP laptop Windows 11 but unfortunately, I can't find the command prompt when I go in to troubleshoot I see only the start-up settings and UEFI firmware I can't find the command prompt please help thanks by the way I...
  3. Powershell command to change application advance security settings in registry.

    in Windows 10 Customization
    Powershell command to change application advance security settings in registry.: In order to collect application data in the security audit logs for EventViewer the application permissions in the registry need to be adjusted. I have done this manually and have it working with Azure Sentinel. I need to deploy this across the entire range of assigned...
  4. DNS settings?

    in Windows 10 Network and Sharing
    DNS settings?: All of a sudden, I'm having problems with my wifi dropping. It's not the router. The all of of this stops for days and then starts again. When I run the MS diagnostics it tells me to check my DNS serttings, etc. When i use search, it is periodicaly telling me ethat...
  5. DNS Settings

    in Windows 10 Network and Sharing
    DNS Settings: Hello I was looking for different ways to help speed up my slow ADSL connection. I learned that changing your DNS settings to use a different provider is something that you could actually do for free So I did a search in google for the fastest DNS servers in Australia and I...
  6. Weird mshome.net DNS entries

    in Windows 10 Ask Insider
    Weird mshome.net DNS entries: Hi, so just out of curiosity I ran an ipconfig /displaydns, which showed me lots of entries, but the mshome.net ones looked suspicious, so I ran a ipconfig /flushdns and immediatley after that I ran another ipconfig /displaydns. Now all the entries except the mshome.net...
  7. DNS Entry Information

    in Windows 10 Network and Sharing
    DNS Entry Information: Where can I find DNS information similar to the information I can get from ipconfig /displaydns? Are they stored in a file? https://answers.microsoft.com/en-us/windows/forum/all/dns-entry-information/9324db66-26da-484e-acf0-ec07491301cd
  8. Suspicious entries in dns cache

    in AntiVirus, Firewalls and System Security
    Suspicious entries in dns cache: I've spotted some suspicious entries in the dns cache. The domains seem to be of chinese origin and they have been reported by some as malware. I've run anti-malware programs, flushed the dns cache, changed the preferred dns, restarted my computer and so on, but they are...
  9. Suspicious entries in dns cache

    in Windows 10 Network and Sharing
    Suspicious entries in dns cache: I've spotted some suspicious entries in the dns cache. The domains seem to be of chinese origin and they have been reported by some as malware. I've run anti-malware programs, flushed the dns cache, changed the preferred dns, restarted my computer and so on, but they are...
  10. DNS Cache Suspicious Entries

    in Windows 10 Network and Sharing
    DNS Cache Suspicious Entries: Hello, I have a DNS entry which never goes away even after flushing it multiple times and restarting the machine. I would like to know if there is a way to identify which program/application is constantly trying to access the network so that I can remove this suspicious...