networking - How to set DNS server address temporarily? - Ask Ubuntu


at workplace dhcp server goes down.

so made script sets ip address , netmask using ifconfig , default gateway using route. i'm yet find command assign dns server temporarily.

is there command can use set dns server address eth0 temporarily? if dhcp server comes back, can reconnect using dhcp without hard coding configuration file.

write /etc/resolv.conf:

echo "nameserver 1.2.3.4" | sudo tee /etc/resolv.conf 

upon successful dhcp connection, should overwritten "correct" dns server.


Comments

Popular posts from this blog

debian - Kali Linux - Debootstrap error Failed to determine codename for the release - Super User

crash - Windows Rundll32 (child process of DllHost) is crashing. How can I even identify it? - Super User

Windows XP installation, no previous version of Windows NT - Super User