Linux
Under Linux / UNIX / BSD operating system, you need to edit the /etc/resolv.conf file and add the line:
nameserver {IP-OF-THE-DNS-1}
nameserver {IP-OF-THEISP-DNS-SERVER-2}
Login as the root, enter:
# vi /etc/resolv.conf
OR
$ sudo vi /etc/resolv.conf
Modify or enter nameserver as follows:
nameserver 208.67.222.222
nameserver 208.67.220.220
macOS
To change DNS settings from the command line, open up Terminal and run this to get a list of all the network interfaces:
networksetup listallnetworkservices
This will return a list similar to this:
An asterisk (*) denotes that a network service is disabled.
Bluetooth DUN
Ethernet
FireWire
Wi-Fi
Now you can configure DNS for the appropriate network interface. In my case, I want to update DNS for the “Wi-Fi” interface. To change to the DNS server settings to the local DNS server, do this:
sudo networksetup -setdnsservers Wi-Fi 192.168.1.254
sudo networksetup -setdnsservers Wi-Fi 8.8.8.8 8.8.4.4
You can put as many (or as few) DNS servers in the list; simply separate each with a space as shown in the second example above.
Reference
FEATURED TAGS
algorithm
algorithmproblem
architecturalpattern
architecture
aws
c#
cachesystem
codis
compile
concurrentcontrol
database
dataformat
datastructure
debug
design
designpattern
distributedsystem
django
docker
domain
engineering
freebsd
git
golang
grafana
hackintosh
hadoop
hardware
hexo
http
hugo
ios
iot
java
javaee
javascript
kafka
kubernetes
linux
linuxcommand
linuxio
lock
macos
markdown
microservices
mysql
nas
network
networkprogramming
nginx
node.js
npm
oop
openwrt
operatingsystem
padavan
performance
programming
prometheus
protobuf
python
redis
router
security
shell
software testing
spring
sql
systemdesign
truenas
ubuntu
vmware
vpn
windows
wmware
wordpress
xml
zookeeper