ubuntu set dns terminal
echo nameserver 8.8.8.8 | sudo tee /etc/resolv.conf
ubuntu set dns terminal
echo nameserver 8.8.8.8 | sudo tee /etc/resolv.conf
ubuntu dns config
#First install resolvconf if not installed
sudo apt update
sudo apt install resolvconf
## check resolvconf service started and enabled
sudo systemctl status resolvconf.service
## if service is not enabled you can start and enable it with
sudo systemctl start resolvconf.service
sudo systemctl enable resolvconf.service
## now edit resolv.conf.d/head configuration file
sudo nano /etc/resolvconf/resolv.conf.d/head
## I use ubuntu 20.04 and unfortunately non of the other answers worked for me so I share the way I fixed this problem
first install resolvconf if not installed
sudo apt update
sudo apt install resolvconf
check resolvconf service started and enabled
sudo systemctl status resolvconf.service
if service is not enabled you can start and enable it with :
sudo systemctl start resolvconf.service
sudo systemctl enable resolvconf.service
now edit resolv.conf.d/head configuration file
sudo nano /etc/resolvconf/resolv.conf.d/head
##add your DNS addresses to this file for example I use (8.8.8.8 and 8.8.4.4)
nameserver 8.8.8.8
nameserver 8.8.4.4
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us