Changing Name Servers - Texnomic/SecureDNS GitHub Wiki
Introduction
The following guides explain how to change DNS Name-Servers on each Operating System in order to point them to SecureDNS Server IP Address.
Note |
---|
The following examples assumes SecureDNS Server is running & listening on 127.0.0.1 |
Windows
Option 1: Network Connections
- Open
Start Menu
. - Type
View Network Connections
then Click on it. - Right-Click
Network Adapter
& ClickProperties
. - Under
Networking
Tab, Double-ClickInternet Protocol Version 4 (TCP/IPv4)
. - Under
General
Tab, SelectUse the following DNS server addresses
. - Type 127.0.0.1 in
Preferred DNS Server
&Alternate DNS Server
.
Option 2: PowerShell
# Setting DNS Servers
Get-NetAdapter -Physical | ForEach-Object { Set-DnsClientServerAddress $_.Name -ServerAddresses ("127.0.0.1") }
# Resetting DNS Servers
Get-NetAdapter -Physical | ForEach-Object { Set-DnsClientServerAddress $_.Name -ResetServerAddresses }
MacOS X
Option 1: System Preferences
- Open
System Preferences
. - Select
Network
. - Select
Advanced
. - Select
DNS
. - Remove all existing
Name-Servers
. - Add a single
Name-Server
: 127.0.0.1
Option 2: Terminal
> networksetup listallnetworkservices
# From listallnetworkservices output, choose Adapter Name for next command
> networksetup -setdnsservers [Adapter Name] 127.0.0.1
Linux
Option 1: Shell - resolv.conf
echo 'nameserver 127.0.0.1' | sudo tee /etc/resolv.conf > /dev/null
Note |
---|
On Linux, there are a few services which may try to automatically overwrite your resolv.conf , For Example: resolvconf , dhcpcd & NetworkManager . |
Option 2: Shell - resolvconf
If you're using resolvconf, /etc/resolvconf.conf
must be modified:
$ sudo vi /etc/resolvconf.conf
The name_servers
field must be altered in order to truly alter your
resolv.conf:
name_servers="127.0.0.1"
Option 3: Shell - dhcpcd
dhcpcd may try to overwrite your resolv.conf with whatever nameservers are
advertised by your router (usually your ISP's Name-Servers). To prevent this,
/etc/dhcpcd.conf
must be modified:
$ sudo vi /etc/dhcpcd.conf
In the default config, you may see a line which looks like:
option domain_name_servers, domain_name, domain_search, host_name
We want to remove domain_name_servers
, domain_name
, and domain_search
.
option host_name
Option 4: Shell - NetworkManager
Likewise, NetworkManager has similar behavior to dhcpcd. To prevent it from
tainting your resolv.conf, /etc/NetworkManager/NetworkManager.conf
must be
altered:
$ sudo vi /etc/NetworkManager/NetworkManager.conf
The default NetworkManager.conf
is usually empty, but we need to add a dns
option under the [main]
section, resulting in a configuration like:
[main]
dns=none