Setting up per-network DNS server.
by canoe from LinuxQuestions.org on (#5T211)
Hello,
I am running Fedora 35, and am in the midst of setting up my first home-network. I will be running a pi-hole DNS server (among other things). When I am at home I can set my DNS settings to point locally to a 10.0.0.0/24 address, but when I take my laptop out and about, I then have to manually change the DNS settings to something public like 1.1.1.1 for example.
It is not impossible to change manually every time, but gets cumbersome fast. Is there any way to automate this so that when I connect to my home network I can use one set of DNS servers, and elsewhere fallback to 1.1.1.1 or similar? Perhaps based on the SSID or MAC address of the router?
I know DHCP has provisions for this, but currently my home router is owned by my ISP, and they lock it down. Plus I'd rather specify myself if I can.
Thanks.
I am running Fedora 35, and am in the midst of setting up my first home-network. I will be running a pi-hole DNS server (among other things). When I am at home I can set my DNS settings to point locally to a 10.0.0.0/24 address, but when I take my laptop out and about, I then have to manually change the DNS settings to something public like 1.1.1.1 for example.
It is not impossible to change manually every time, but gets cumbersome fast. Is there any way to automate this so that when I connect to my home network I can use one set of DNS servers, and elsewhere fallback to 1.1.1.1 or similar? Perhaps based on the SSID or MAC address of the router?
I know DHCP has provisions for this, but currently my home router is owned by my ISP, and they lock it down. Plus I'd rather specify myself if I can.
Thanks.