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
Post a Comment