Static DNS in Ubuntu Server 16.04

21,544

Assuming you are using resolvconf

Open resolvconf config in gedit via

gksudo gedit /etc/resolvconf/resolv.conf.d/original

This should result in a dialog asking for your password and then open the UI texteditor Gedit with the following file: /etc/resolvconf/resolv.conf.d/original

This file usually contains a line like that

nameserver 8.8.8.8 8.8.4.4

This would mean there are to nameserver configured: - 8.8.8.8 and - 8.8.4.4

Edit the file to your needs and save & quit gedit.

Finish with

sudo resolvconf -u

UPDATE:

Just realized this post covers the topic way better then i did.

Share:
21,544

Related videos on Youtube

E Simon Vijay
Author by

E Simon Vijay

Updated on September 18, 2022

Comments

  • E Simon Vijay
    E Simon Vijay over 1 year

    I am a complete new-be when it comes to Linux and even more so when it concerns Ubuntu.

    I want to configure the IPv4 settings to have automatic assigning of IP address but manual assigning for DNS. How do I do it?

    Please teach me how to do it step by step.

    Please take a look at the image to get an idea of what I am asking.

    Thank you in advance.

    Windows DNS settings example:

    image

    • dufte
      dufte almost 8 years
      Am i assuming right that you added the windows screenshots only as reference, but you want to change the related data on a ubuntu machine?
    • E Simon Vijay
      E Simon Vijay almost 8 years
      You are absolutely right dufte.
  • E Simon Vijay
    E Simon Vijay almost 8 years
    Thank you so much for the information dufte but I do not have gedit installed. I can't install it too because the network will only work if i change the dns settings. please advise.
  • dufte
    dufte almost 8 years
    gedit was just an example. you can replace gedit with nano as well in the commands. But please follow the url i added to my post as it explains better what to do.