Changing DNS Server Addresses

st999
st999 Posts: 1,574 Forumite
Part of the Furniture 1,000 Posts Name Dropper
In Internet Protocol Version 4 DNS server addresses I use 176.103.103.130 and 176.103.103.131 to stop adverts appearing on web pages instead of adblock or other programs in web browsers.

However I occasionally have to go back to Virgins DNS servers as some click adverts cannot be found.

Is there a way to automate the switching on or off of DNS server addresses using a batch file or something similar?

This is in Windows 10.
Control Panel
Network and Sharing Centre
Change Adapter Settings
Properties
Internet Protocol Version 4 (TCP/IPv4)

Comments

  • Neil_Jones
    Neil_Jones Posts: 9,515 Forumite
    Part of the Furniture 1,000 Posts Name Dropper
    Why does an adblocker not work for you? Changing the DNS seems overkill. What are you using at the moment? Tried another ad blocker?
  • debitcardmayhem
    debitcardmayhem Posts: 12,504 Forumite
    Part of the Furniture 10,000 Posts Name Dropper Photogenic
    edited 22 January 2020 at 8:52PM
    You can do it using PowerShell in admin mode eg
     Get-DnsClient | Set-DnsClientServerAddress -ServerAddresses ("8.8.8.8","8.8.4.4"
    
    and to reset back
    Get-DnsClient | Set-DnsClientServerAddress -ResetServerAddresses
    
    Or look here lifewire.com / how-to-change-dns-servers-in-windows-2626242
    and remove the spaces
    4.8kWp 12x400W Longhi 9.6 kWh battery Giv-hy 5.0 Inverter, WSW facing Essex . Aint no sunshine ☀️ Octopus gas fixed dec 24 @ 5.74 + Octopus Intelligent Flux leccy
  • st999
    st999 Posts: 1,574 Forumite
    Part of the Furniture 1,000 Posts Name Dropper
    Why does an adblocker not work for you?

    Some sites detect the adblocker and keep popping up pop-ups.
    Changing the DNS seems overkill.
    I read it in a magazine and thought it might be better than an adblocker.
  • st999
    st999 Posts: 1,574 Forumite
    Part of the Furniture 1,000 Posts Name Dropper
    You can do it using PowerShell in admin mode eg
     Get-DnsClient | Set-DnsClientServerAddress -ServerAddresses ("8.8.8.8","8.8.4.4"
    
    and to reset back
    Get-DnsClient | Set-DnsClientServerAddress -ResetServerAddresses
    
    Or look here lifewire.com / how-to-change-dns-servers-in-windows-2626242
    and remove the spaces

    That works perfectly, now to automate it so all I need to do is to click a bat file
  • DoaM
    DoaM Posts: 11,863 Forumite
    10,000 Posts Fifth Anniversary Name Dropper Photogenic
    If you want to get creative ... make a single BAT file and have 2 desktop shortcuts, whereby each shortcut passes a parameter to the BAT file. The BAT file checks the parameter value then executes the appropriate code. :)
This discussion has been closed.
Meet your Ambassadors

🚀 Getting Started

Hi new member!

Our Getting Started Guide will help you get the most out of the Forum

Categories

  • All Categories
  • 349.8K Banking & Borrowing
  • 252.6K Reduce Debt & Boost Income
  • 453K Spending & Discounts
  • 242.8K Work, Benefits & Business
  • 619.6K Mortgages, Homes & Bills
  • 176.4K Life & Family
  • 255.7K Travel & Transport
  • 1.5M Hobbies & Leisure
  • 16.1K Discuss & Feedback
  • 15.1K Coronavirus Support Boards

Is this how you want to be seen?

We see you are using a default avatar. It takes only a few seconds to pick a picture.