How to add an address to DNS

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
4
down vote

favorite
2












My system is Ubuntu 18.04 (Bionic Beaver).



And I want to add 172.26.5.14 to system DNS addresses.



I searched and found some solutions like:



  • Add to /etc/resolv.conf. But data removed neither system or network-manager restart.


  • Add to /etc/resolvconf/resolv.conf.d/base or /etc/resolvconf/resolv.conf.d/head. It's not working and not shown in the nmcli device show enp0s31f6 | grep IP4.DNS result.


How do I add permanently to DNS servers?










share|improve this question









New contributor




Zabih Alipour is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.















  • 1




    Do sudo nmcli con mod help to see how to use it!
    – George Udosen
    7 hours ago










  • @GeorgeUdosen, nmcli not known 'enp0s31f6'
    – Zabih Alipour
    6 hours ago






  • 1




    Use sudo nmcli con show to see the interface names on your system!
    – George Udosen
    6 hours ago






  • 1




    @GeorgeUdosen Thanks, I use UUID
    – Zabih Alipour
    6 hours ago














up vote
4
down vote

favorite
2












My system is Ubuntu 18.04 (Bionic Beaver).



And I want to add 172.26.5.14 to system DNS addresses.



I searched and found some solutions like:



  • Add to /etc/resolv.conf. But data removed neither system or network-manager restart.


  • Add to /etc/resolvconf/resolv.conf.d/base or /etc/resolvconf/resolv.conf.d/head. It's not working and not shown in the nmcli device show enp0s31f6 | grep IP4.DNS result.


How do I add permanently to DNS servers?










share|improve this question









New contributor




Zabih Alipour is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.















  • 1




    Do sudo nmcli con mod help to see how to use it!
    – George Udosen
    7 hours ago










  • @GeorgeUdosen, nmcli not known 'enp0s31f6'
    – Zabih Alipour
    6 hours ago






  • 1




    Use sudo nmcli con show to see the interface names on your system!
    – George Udosen
    6 hours ago






  • 1




    @GeorgeUdosen Thanks, I use UUID
    – Zabih Alipour
    6 hours ago












up vote
4
down vote

favorite
2









up vote
4
down vote

favorite
2






2





My system is Ubuntu 18.04 (Bionic Beaver).



And I want to add 172.26.5.14 to system DNS addresses.



I searched and found some solutions like:



  • Add to /etc/resolv.conf. But data removed neither system or network-manager restart.


  • Add to /etc/resolvconf/resolv.conf.d/base or /etc/resolvconf/resolv.conf.d/head. It's not working and not shown in the nmcli device show enp0s31f6 | grep IP4.DNS result.


How do I add permanently to DNS servers?










share|improve this question









New contributor




Zabih Alipour is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











My system is Ubuntu 18.04 (Bionic Beaver).



And I want to add 172.26.5.14 to system DNS addresses.



I searched and found some solutions like:



  • Add to /etc/resolv.conf. But data removed neither system or network-manager restart.


  • Add to /etc/resolvconf/resolv.conf.d/base or /etc/resolvconf/resolv.conf.d/head. It's not working and not shown in the nmcli device show enp0s31f6 | grep IP4.DNS result.


How do I add permanently to DNS servers?







networking network-manager dns






share|improve this question









New contributor




Zabih Alipour is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question









New contributor




Zabih Alipour is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question








edited 20 mins ago









Peter Mortensen

1,03821016




1,03821016






New contributor




Zabih Alipour is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked 8 hours ago









Zabih Alipour

1234




1234




New contributor




Zabih Alipour is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





Zabih Alipour is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






Zabih Alipour is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.







  • 1




    Do sudo nmcli con mod help to see how to use it!
    – George Udosen
    7 hours ago










  • @GeorgeUdosen, nmcli not known 'enp0s31f6'
    – Zabih Alipour
    6 hours ago






  • 1




    Use sudo nmcli con show to see the interface names on your system!
    – George Udosen
    6 hours ago






  • 1




    @GeorgeUdosen Thanks, I use UUID
    – Zabih Alipour
    6 hours ago












  • 1




    Do sudo nmcli con mod help to see how to use it!
    – George Udosen
    7 hours ago










  • @GeorgeUdosen, nmcli not known 'enp0s31f6'
    – Zabih Alipour
    6 hours ago






  • 1




    Use sudo nmcli con show to see the interface names on your system!
    – George Udosen
    6 hours ago






  • 1




    @GeorgeUdosen Thanks, I use UUID
    – Zabih Alipour
    6 hours ago







1




1




Do sudo nmcli con mod help to see how to use it!
– George Udosen
7 hours ago




Do sudo nmcli con mod help to see how to use it!
– George Udosen
7 hours ago












@GeorgeUdosen, nmcli not known 'enp0s31f6'
– Zabih Alipour
6 hours ago




@GeorgeUdosen, nmcli not known 'enp0s31f6'
– Zabih Alipour
6 hours ago




1




1




Use sudo nmcli con show to see the interface names on your system!
– George Udosen
6 hours ago




Use sudo nmcli con show to see the interface names on your system!
– George Udosen
6 hours ago




1




1




@GeorgeUdosen Thanks, I use UUID
– Zabih Alipour
6 hours ago




@GeorgeUdosen Thanks, I use UUID
– Zabih Alipour
6 hours ago










2 Answers
2






active

oldest

votes

















up vote
5
down vote



accepted










The easiest way is to go to



Settings -> Network -> LAN Interface (Cog Symbol) -> IPv4 Settings (tab) -> Additional DNS Servers



If you must do it from the command line, then you can type:



sudo nmcli con mod enp0s31f6 ipv4.dns "172.26.5.14"


update with:



sudo nmcli con up "enp0s31f6"





share|improve this answer






















  • When run first command show error: Error: unknown connection 'enp0s31f6'.
    – Zabih Alipour
    6 hours ago










  • I use: sudo nmcli con mod 'MY-UUID' +ipv4.dns "172.26.5.14", and it work, Thanks all
    – Zabih Alipour
    6 hours ago

















up vote
0
down vote













On servers, edit /etc/netplan/50-cloud-init.yaml



network:
version: 2
ethernets:
eth0:
addresses: [10.10.10.253/24]
gateway4: 10.10.10.1
nameservers:
addresses: [127.0.0.1,127.0.0.53]


Replace with your own addresses.



Then



sudo netplan apply





share|improve this answer




















  • This .yaml script requires renderer: networkd, and probably dhcp4: no. And the proper terminal commands should be sudo netplan --debug generate, then sudo netplan apply.
    – heynnema
    2 hours ago











Your Answer







StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "89"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);






Zabih Alipour is a new contributor. Be nice, and check out our Code of Conduct.









 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1083656%2fhow-to-add-an-address-to-dns%23new-answer', 'question_page');

);

Post as a guest






























2 Answers
2






active

oldest

votes








2 Answers
2






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
5
down vote



accepted










The easiest way is to go to



Settings -> Network -> LAN Interface (Cog Symbol) -> IPv4 Settings (tab) -> Additional DNS Servers



If you must do it from the command line, then you can type:



sudo nmcli con mod enp0s31f6 ipv4.dns "172.26.5.14"


update with:



sudo nmcli con up "enp0s31f6"





share|improve this answer






















  • When run first command show error: Error: unknown connection 'enp0s31f6'.
    – Zabih Alipour
    6 hours ago










  • I use: sudo nmcli con mod 'MY-UUID' +ipv4.dns "172.26.5.14", and it work, Thanks all
    – Zabih Alipour
    6 hours ago














up vote
5
down vote



accepted










The easiest way is to go to



Settings -> Network -> LAN Interface (Cog Symbol) -> IPv4 Settings (tab) -> Additional DNS Servers



If you must do it from the command line, then you can type:



sudo nmcli con mod enp0s31f6 ipv4.dns "172.26.5.14"


update with:



sudo nmcli con up "enp0s31f6"





share|improve this answer






















  • When run first command show error: Error: unknown connection 'enp0s31f6'.
    – Zabih Alipour
    6 hours ago










  • I use: sudo nmcli con mod 'MY-UUID' +ipv4.dns "172.26.5.14", and it work, Thanks all
    – Zabih Alipour
    6 hours ago












up vote
5
down vote



accepted







up vote
5
down vote



accepted






The easiest way is to go to



Settings -> Network -> LAN Interface (Cog Symbol) -> IPv4 Settings (tab) -> Additional DNS Servers



If you must do it from the command line, then you can type:



sudo nmcli con mod enp0s31f6 ipv4.dns "172.26.5.14"


update with:



sudo nmcli con up "enp0s31f6"





share|improve this answer














The easiest way is to go to



Settings -> Network -> LAN Interface (Cog Symbol) -> IPv4 Settings (tab) -> Additional DNS Servers



If you must do it from the command line, then you can type:



sudo nmcli con mod enp0s31f6 ipv4.dns "172.26.5.14"


update with:



sudo nmcli con up "enp0s31f6"






share|improve this answer














share|improve this answer



share|improve this answer








edited 7 hours ago









George Udosen

17.6k93963




17.6k93963










answered 7 hours ago









tudor

1,88821642




1,88821642











  • When run first command show error: Error: unknown connection 'enp0s31f6'.
    – Zabih Alipour
    6 hours ago










  • I use: sudo nmcli con mod 'MY-UUID' +ipv4.dns "172.26.5.14", and it work, Thanks all
    – Zabih Alipour
    6 hours ago
















  • When run first command show error: Error: unknown connection 'enp0s31f6'.
    – Zabih Alipour
    6 hours ago










  • I use: sudo nmcli con mod 'MY-UUID' +ipv4.dns "172.26.5.14", and it work, Thanks all
    – Zabih Alipour
    6 hours ago















When run first command show error: Error: unknown connection 'enp0s31f6'.
– Zabih Alipour
6 hours ago




When run first command show error: Error: unknown connection 'enp0s31f6'.
– Zabih Alipour
6 hours ago












I use: sudo nmcli con mod 'MY-UUID' +ipv4.dns "172.26.5.14", and it work, Thanks all
– Zabih Alipour
6 hours ago




I use: sudo nmcli con mod 'MY-UUID' +ipv4.dns "172.26.5.14", and it work, Thanks all
– Zabih Alipour
6 hours ago












up vote
0
down vote













On servers, edit /etc/netplan/50-cloud-init.yaml



network:
version: 2
ethernets:
eth0:
addresses: [10.10.10.253/24]
gateway4: 10.10.10.1
nameservers:
addresses: [127.0.0.1,127.0.0.53]


Replace with your own addresses.



Then



sudo netplan apply





share|improve this answer




















  • This .yaml script requires renderer: networkd, and probably dhcp4: no. And the proper terminal commands should be sudo netplan --debug generate, then sudo netplan apply.
    – heynnema
    2 hours ago















up vote
0
down vote













On servers, edit /etc/netplan/50-cloud-init.yaml



network:
version: 2
ethernets:
eth0:
addresses: [10.10.10.253/24]
gateway4: 10.10.10.1
nameservers:
addresses: [127.0.0.1,127.0.0.53]


Replace with your own addresses.



Then



sudo netplan apply





share|improve this answer




















  • This .yaml script requires renderer: networkd, and probably dhcp4: no. And the proper terminal commands should be sudo netplan --debug generate, then sudo netplan apply.
    – heynnema
    2 hours ago













up vote
0
down vote










up vote
0
down vote









On servers, edit /etc/netplan/50-cloud-init.yaml



network:
version: 2
ethernets:
eth0:
addresses: [10.10.10.253/24]
gateway4: 10.10.10.1
nameservers:
addresses: [127.0.0.1,127.0.0.53]


Replace with your own addresses.



Then



sudo netplan apply





share|improve this answer












On servers, edit /etc/netplan/50-cloud-init.yaml



network:
version: 2
ethernets:
eth0:
addresses: [10.10.10.253/24]
gateway4: 10.10.10.1
nameservers:
addresses: [127.0.0.1,127.0.0.53]


Replace with your own addresses.



Then



sudo netplan apply






share|improve this answer












share|improve this answer



share|improve this answer










answered 6 hours ago









R J

1808




1808











  • This .yaml script requires renderer: networkd, and probably dhcp4: no. And the proper terminal commands should be sudo netplan --debug generate, then sudo netplan apply.
    – heynnema
    2 hours ago

















  • This .yaml script requires renderer: networkd, and probably dhcp4: no. And the proper terminal commands should be sudo netplan --debug generate, then sudo netplan apply.
    – heynnema
    2 hours ago
















This .yaml script requires renderer: networkd, and probably dhcp4: no. And the proper terminal commands should be sudo netplan --debug generate, then sudo netplan apply.
– heynnema
2 hours ago





This .yaml script requires renderer: networkd, and probably dhcp4: no. And the proper terminal commands should be sudo netplan --debug generate, then sudo netplan apply.
– heynnema
2 hours ago











Zabih Alipour is a new contributor. Be nice, and check out our Code of Conduct.









 

draft saved


draft discarded


















Zabih Alipour is a new contributor. Be nice, and check out our Code of Conduct.












Zabih Alipour is a new contributor. Be nice, and check out our Code of Conduct.











Zabih Alipour is a new contributor. Be nice, and check out our Code of Conduct.













 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1083656%2fhow-to-add-an-address-to-dns%23new-answer', 'question_page');

);

Post as a guest













































































Comments

Popular posts from this blog

What does second last employer means? [closed]

Installing NextGIS Connect into QGIS 3?

One-line joke