I'm trying to configure my DNS settings to use other DNS servers that the one from my ISP, however when I add DNS addresses to my network configuration they are overridden when reconnecting to my home network. I use the router from my ISP which automatically serve it's own DNS address when the DHCP server assign an IP.

I found a script that can be used to change the DNS settings on the fly but it would need to run every time my laptop wakes-up or reconnect to my home network, there must be a better way to make a DNS configuration permanent.

  • 1
    There is generally no good reason for a PC on a local network to use an external DNS server directly. Is there any particular reason you'd like to do this? You might like to configure your router to use (forward to) the DNS servers you desire instead...
    – Attie
    May 11, 2018 at 18:33
  • My router (the one from my ISP) doesn't allow to change the default DNS server, I can add more but the DNS from my ISP will always be the first of the list
    – N.Bv
    May 14, 2018 at 7:35

2 Answers 2


I don't know how accurate the answer is. Since you have a script that can change your DNS settings. I am suggesting this answer.

If you are using Linux machine you can place the command in scripts that run on startup like bash_profile.

to bash_profile add one more line which to execute that script

source [scriptname]

  • I'm running MacOS, your solution could work but the script needs to run at each wake up of the laptop, not only start up. And again it is not really a proper way to make a DNS configuration stick.
    – N.Bv
    May 14, 2018 at 7:41
  • Use Automator app to run the shell script / checkout the above discussion is stack overflow . askubuntu.com/questions/226278/run-script-on-wakeup Hope this solves your issue of running script on each wakeup I just gave a solution to run the script on each startup / wakeup. May 15, 2018 at 13:03

I am not sure I understand the question. You mentioned that you want to configure your computer to use the ISP settings and then indicate it is using the ISP settings.

If what you want to do is use different DNS settings than the ISP, can you: 1. Configure the router to use a different DNS server of your choosing 2. or - use a static IP address and stop using D

  • My question was a bit ambiguous, I changed it. I don't want to use my ISP's DNS, I want to be able to set the one i want or for example. For a wired network static IP can make sense but it's for a Wi-Fi network and I would like to be able to have people join the network easily.
    – N.Bv
    May 14, 2018 at 7:45

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .