Update DNS


JWMutant

Recommended Posts

Evening all,

 

Just a quick question for those who know.

 

Does anyone know how to update the DNS via ssh?

 

Im not that crash hot with my linux commands... my knowledge doesnt go past ifconfig. :-)

 

But if there is a way to flush and update the DNS via ssh would someone be able to post up a idiots guide on how to do so.

 

Appreciated.

 

Link to comment

DNS settings are located in /etc/resolv.conf

 

root@Tower:~# cat /etc/resolv.conf
# Generated entries:
nameserver 172.19.10.1
root@Tower:~# echo "nameserver 8.8.8.8" > /etc/resolv.conf
root@Tower:~# cat /etc/resolv.conf
nameserver 8.8.8.8
root@Tower:~# echo "nameserver 172.19.40.1" > /etc/resolv.conf
root@Tower:~# cat /etc/resolv.conf
nameserver 172.19.40.1
root@Tower:~#

 

Or you can simply edit with vi or nano

Edited by Tuftuf
  • Upvote 1
Link to comment
1 minute ago, Tuftuf said:

DNS settings are located in /etc/resolv.conf

 

root@Tower:~# cat /etc/resolv.conf
# Generated entries:
nameserver 172.19.10.1
root@Tower:~# echo "nameserver 8.8.8.8" > /etc/resolv.conf
root@Tower:~# cat /etc/resolv.conf
nameserver 8.8.8.8
root@Tower:~# echo "nameserver 172.19.40.1" > /etc/resolv.conf
root@Tower:~# cat /etc/resolv.conf
nameserver 172.19.40.1
root@Tower:~#

Thank You.

 

Do you happen to know if there is a way to update the gateway without doing a reboot?

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.