if it's empty: create the file,
sudo nano /etc/resolv.confThen add,
nameserver (your default gateway ip)If you don't know what your default gateway is type in,
ip r | grep defaultOr, simply add nameserver 8.8.8.8 and save the file
service network-manager restart for old distros
sudo service NetworkManager restart for new distros
If your /etc/resolv.conf is lacking permissions, type in chmod o+r /etc/resolv.conf or delete that file and create a new one.
For new distros,
systemctl list-unit-files | grep NetworkManager.serviceFor old distros,
systemctl list-unit-files | grep network-manager.servicelook for masked within the output
if NetworkManager.service is masked then unmasking it will eventually remove the service from the /etc/systemd/system directory.
So, It's better not to unmask it. else installing the network-manager package will fix it.
dhclient Your-Interface-Namedhclient eth0 for example. If you only have WIFI as a resource and don't have the GUI thing set up, follow
connect wifi from terminal
then type in dhclient wlan0
For new distros,
sudo apt install network-manager
sudo service NetworkManager restart
sudo service NetworkManager statusFor old distros,
sudo apt install network-manager
sudo service network-manager restart
sudo service network-manager statusTo install the GUI, sudo apt install network-manager-gnome. To open it type in
nm-connection-editor from terminal.