[mythtv-users] connection does not survive a reboot

Stephen Worthington stephen_agent at jsw.gen.nz
Sat Jan 7 16:23:29 UTC 2023


On Sat, 7 Jan 2023 09:09:36 -0500, you wrote:

>I am not able to edit this file:
>daryl at trieli:~$ cat /etc/resolv.conf
># This file is managed by man:systemd-resolved(8). Do not edit.
>#
># This is a dynamic resolv.conf file for connecting local clients to the
># internal DNS stub resolver of systemd-resolved. This file lists all
># configured search domains.
>#
># Run "resolvectl status" to see details about the uplink DNS servers
># currently in use.
>#
># 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 127.0.0.53
>options edns0 trust-ad
>
>Using nano it reverts immediately, I can edit the linked
>(/run/systemd/resolve/resolv.conf) file, changing the last two lines to :
>nameserver 8.8.8.8, and nameserver 8.8.4.4 will establish an internet
>connection, but it does not survive a reboot.
>Any suggestions on how to remedy this?
>
>TIA  Daryl

The /run directory tree is a virtual file system created at boot time
- it is all re-created each boot.  Normally, if the PC is getting its
IP address via DHCP, it will also be getting the DNS server settings
via DHCP from your router (which the router received from its
connection to your ISP).  And it will all work completely
automatically.  But if you have manually assigned a static IP address,
no DHCP is being used and you will normally have to assign static DNS
server addresses also.

In recent Ubuntu versions, NetworkManager controls the network setup,
and you will have used a GUI to tell it to use a static IP address. So
you need to also tell it the correct DNS settings and have it put them
in /etc/resolv.conf.  The way to do that varies depending on which
desktop you are using.  Gnome has GUI that can do it in the Network
section of its Settings program, below where you set a static IP
address.

If you are using a desktop that does not have such a way of setting it
up (such as XFCE), I find the easiest way is to do static settings in
the /etc/network/interfaces file.  Originally, this was the only
method of configuring network connections and there were scripts that
read the interfaces file and set things up from those settings.  But
after NetworkManager came along, it now does that itself.  If it finds
settings for an interface in the interfaces file, it will use those
settings and not do its usual automatic configuration of that network
interface.  Here is an example of what I have to make my mother's
MythTV box work on my network:

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
  address 10.0.2.8
  network 10.0.2.0
  netmask 255.255.255.0
  gateway 10.0.2.251
  dns-nameservers 10.0.2.12 10.0.2.4
  dns-search jsw.gen.nz
iface eth0 inet6 static
  address 2406:E001:1:2802::8
  netmask 64
  gateway 2406:E001:1:2802::251
  dns-nameservers 2406:E001:1:2802::12 2406:E001:1:2802::4
  dns-search 6.jsw.gen.nz

Note that I run my own internal DNS servers, so the addresses for them
are on my local network.  The dns-search lines tell the system to add
the listed partial name to the end of any incomplete names that are
looked up in the DNS.  So if I look up "crw-pvr", it would actually be
looked up as "crw-pvr.jsw.gen.nz".  So you would not normally use
those lines unless you are running a local DNS server.

Rather than using the Google DNS servers (8.8.8.8 and 8.8.4.4), it is
better to find your ISP's DNS server addresses (usually available on a
page in your router's setup pages or your ISP's help pages).  ISPs
often have services on their internal network such CDN servers that
you really want to use in preference to connecting to a different copy
of the CDN service that is much further away.  And that is done by
getting the correct IP addresses from your ISP's DNS servers.


More information about the mythtv-users mailing list