User Tools

Site Tools


ubuntu:networking:dns:etc_resolv.conf

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
ubuntu:networking:dns:etc_resolv.conf [2021/01/10 20:57] peterubuntu:networking:dns:etc_resolv.conf [2021/01/13 11:05] (current) – [Display /etc/resolv.conf] peter
Line 7: Line 7:
   * **/etc/resolv.conf** is nowadays maintained by systemd.   * **/etc/resolv.conf** is nowadays maintained by systemd.
   * If DNS resolver changes are needed then do this through systemd.   * If DNS resolver changes are needed then do this through systemd.
 +</WRAP>
 +
 +----
 +
 +===== List /etc/resolv.conf =====
 +
 +<code bash>
 +ls -al /etc/resolv.conf
 +</code>
 +
 +returns:
 +
 +<code bash>
 +lrwxrwxrwx 1 root root 32 Jan 10 18:50 /etc/resolv.conf -> /run/systemd/resolve/resolv.conf
 +</code>
 +
 +<WRAP info>
 +**NOTE:**  This shows that **/etc/resolv.conf** is a symlink to **/run/systemd/resolve/resolv.conf**.
 +
 +It may instead be a symlink to **/run/systemd/resolve/stub-resolv.conf**.  Also ok.
 +
 +If not then to fix try:
 +
 +<code bash>
 +sudo ln -sf /run/systemd/resolve/resolv.conf /etc/resolv.conf
 +</code>
 +
 +</WRAP>
 +
 +----
 +
 +===== Display /etc/resolv.conf =====
 +
 +<code bash>
 +cat /etc/resolv.conf
 +</code>
 +
 +returns:
 +
 +<code bash>
 +# This file is managed by man:systemd-resolved(8). Do not edit.
 +#
 +# This is a dynamic resolv.conf file for connecting local clients directly to
 +# all known uplink DNS servers. This file lists all configured search domains.
 +#
 +# Third party programs must not access this file directly, but only through the
 +# symlink at /etc/resolv.conf. To manage man:resolv.conf(5) in a different way,
 +# replace this symlink by a static file or a different symlink.
 +#
 +# See man:systemd-resolved.service(8) for details about the supported modes of
 +# operation for /etc/resolv.conf.
 +
 +nameserver 192.168.1.1
 +search localdomain
 +</code>
 +
 +<WRAP info>
 +**NOTE:**  If the **nameserver** is **127.0.0.53** then this is fine too - It is set as default by Ubuntu.
 +
 +Usually it would only show as 192.168.1.1 or similar if DNS changes had been made in networking settings; such as in /etc/netplan.
 +
 </WRAP> </WRAP>
  
Line 50: Line 111:
   * For a static configuration using ifup, use **dns-nameservers** and **dns-search** entries in /etc/network/interfaces.   * For a static configuration using ifup, use **dns-nameservers** and **dns-search** entries in /etc/network/interfaces.
   * For a static configuration using NetworkManager, select the Automatic (DHCP) addresses only Method and enter addresses and domain names in the Additional DNS servers and Additional search domains fields in the Connection Editor.   * For a static configuration using NetworkManager, select the Automatic (DHCP) addresses only Method and enter addresses and domain names in the Additional DNS servers and Additional search domains fields in the Connection Editor.
 +  * If using netplan, set the DNS within **/etc/netplan/01-network-manager-all.yaml**.
   * To override resolvconf's default configuration, use base, head and tail in /etc/resolvconf/resolv.conf.d/. Only enter addresses and domain names in these files as a temporary measure, since they really belong elsewhere, as described above.   * To override resolvconf's default configuration, use base, head and tail in /etc/resolvconf/resolv.conf.d/. Only enter addresses and domain names in these files as a temporary measure, since they really belong elsewhere, as described above.
  
Line 58: Line 120:
 ---- ----
  
-===== This no longer works ===== 
- 
-<WRAP danger> 
-**DANGER**:  Manual changes to resolv.conf will be overridden, since Ubuntu 12.04. 
-</WRAP> 
- 
- 
-The **resolv.conf** file typically contains the IP addresses of nameservers (DNS name resolvers) that attempt to translate names into addresses for any node available on the network. 
- 
-Edit the /etc/resolv.conf file: 
- 
-<code bash> 
-vi /etc/resolv.conf 
-</code> 
- 
-Add the nameservers as follows: 
- 
-<file bash /etc/resolv.conf> 
-search sharewiz.net 
-nameserver 5.42.134.35 
-nameserver 8.8.8.8 
-nameserver 8.8.4.4 
-</file> 
- 
-<WRAP info> 
-**NOTE**:  Maximum of three nameservers can be defined at a time. 
-</WRAP> 
- 
- 
----- 
  
 ===== Test ===== ===== Test =====
ubuntu/networking/dns/etc_resolv.conf.1610312243.txt.gz · Last modified: 2021/01/10 20:57 by peter

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki