But no /etc/resolv.conf. No file, no symlink.
It is created by openresolv, when the network is started (or restarted).
It is not the task of Enigma to meddle in linux network services.
Yes it does exist. Looked over it.
Posted 27 February 2023 - 08:56
But no /etc/resolv.conf. No file, no symlink.
It is created by openresolv, when the network is started (or restarted).
It is not the task of Enigma to meddle in linux network services.
Yes it does exist. Looked over it.
Dreambox dm920, Uclan Ustym4Kpro, Gigablue UHD TRIO 4K and Dreambox dm8000. Wavefrontier T55 13.0|19.2|23.5|28.2 + Ziggo.
Posted 27 February 2023 - 08:56
Posted 27 February 2023 - 09:00
Problem is elf.ifaces["eth0"]["dns-nameserver"] doesn't update with defined nameservers.
self.nameservers is only written to /etc/resolv.conf.,
I use this patch for now.
diff --git a/lib/python/Components/Network.py b/lib/python/Components/Network.py index 04e20e745..2c5d56b1b 100644 --- a/lib/python/Components/Network.py +++ b/lib/python/Components/Network.py @@ -90,6 +90,7 @@ class Network: def writeNetworkConfig(self): self.configuredInterfaces = [] + self.ifaces["eth0"]["dns-nameserver"] = self.nameservers fp = open('/etc/network/interfaces', 'w') fp.write("# automatically generated by enigma2\n# do NOT change manually!\n\n") fp.write("auto lo\n") @@ -109,15 +112,15 @@ class Network: fp.write(" netmask %d.%d.%d.%d\n" % tuple(iface['netmask'])) if 'gateway' in iface: fp.write(" gateway %d.%d.%d.%d\n" % tuple(iface['gateway'])) + if iface["dns-nameserver"]: + for nameserver in iface["dns-nameserver"]: + fp.write(" dns-nameservers %d.%d.%d.%d\n" % tuple(nameserver)) if "configStrings" in iface: fp.write(iface["configStrings"]) if iface["preup"] and "configStrings" not in iface: fp.write(iface["preup"]) if iface["predown"] and "configStrings" not in iface: fp.write(iface["predown"]) - if iface["dns-nameserver"]: - for nameserver in iface["dns-nameserver"]: - fp.write(" dns-nameserver %d.%d.%d.%d\n" % tuple(nameserver)) fp.write("\n") fp.close() self.configuredNetworkAdapters = self.configuredInterfaces @@ -177,7 +180,7 @@ class Network: if split[0] in ("pre-down", "post-down"): if "predown" in self.ifaces[currif]: self.ifaces[currif]["predown"] = i - if split[0] == "dns-nameserver": + if split[0] == "dns-nameservers": if "dns-nameserver" not in self.ifaces[currif]: self.ifaces[currif]["dns-nameserver"] = [] dns_ip = self.convertIP(split[1])
Dreambox dm920, Uclan Ustym4Kpro, Gigablue UHD TRIO 4K and Dreambox dm8000. Wavefrontier T55 13.0|19.2|23.5|28.2 + Ziggo.
Posted 27 February 2023 - 09:23
One problem found in network.py
dns-nameserver must be dns-nameservers.
In fact, for several nameservers, the correct format is:
dns-nameservers 8.8.8.8 4.4.4.4Not multiple lines with dns-nameservers, as suggested in the code.
Like this.
+ if iface["dns-nameserver"]: + fp.write(" dns-nameservers") + for nameserver in iface["dns-nameserver"]: + fp.write(" %d.%d.%d.%d" % tuple(nameserver)) + fp.write("\n")
Need to update the reading code as well.
Edited by Beeker, 27 February 2023 - 09:24.
Dreambox dm920, Uclan Ustym4Kpro, Gigablue UHD TRIO 4K and Dreambox dm8000. Wavefrontier T55 13.0|19.2|23.5|28.2 + Ziggo.
Posted 27 February 2023 - 09:35
Even with openresolv installed, after restart the file resolv.conf in /var/run is empty.
If i manually put the line "dns-nameservers 192.168.1.1" in interfaces, then after restart all is OK. The file resolv.conf contain:
VU+ Ultimo 4K; Clarke-Tech et9000
Posted 27 February 2023 - 09:47
Patch updated to write/read DNS at one line
diff --git a/lib/python/Components/Network.py b/lib/python/Components/Network.py index 04e20e745..d65c59e24 100644 --- a/lib/python/Components/Network.py +++ b/lib/python/Components/Network.py @@ -90,6 +90,7 @@ class Network: def writeNetworkConfig(self): self.configuredInterfaces = [] + self.ifaces["eth0"]["dns-nameserver"] = self.nameservers fp = open('/etc/network/interfaces', 'w') fp.write("# automatically generated by enigma2\n# do NOT change manually!\n\n") fp.write("auto lo\n") @@ -109,15 +110,17 @@ class Network: fp.write(" netmask %d.%d.%d.%d\n" % tuple(iface['netmask'])) if 'gateway' in iface: fp.write(" gateway %d.%d.%d.%d\n" % tuple(iface['gateway'])) + if iface["dns-nameserver"]: + fp.write(" dns-nameservers") + for nameserver in iface["dns-nameserver"]: + fp.write(" %d.%d.%d.%d" % tuple(nameserver)) + fp.write("\n") if "configStrings" in iface: fp.write(iface["configStrings"]) if iface["preup"] and "configStrings" not in iface: fp.write(iface["preup"]) if iface["predown"] and "configStrings" not in iface: fp.write(iface["predown"]) - if iface["dns-nameserver"]: - for nameserver in iface["dns-nameserver"]: - fp.write(" dns-nameserver %d.%d.%d.%d\n" % tuple(nameserver)) fp.write("\n") fp.close() self.configuredNetworkAdapters = self.configuredInterfaces @@ -177,13 +180,14 @@ class Network: if split[0] in ("pre-down", "post-down"): if "predown" in self.ifaces[currif]: self.ifaces[currif]["predown"] = i - if split[0] == "dns-nameserver": + if split[0] == "dns-nameservers": if "dns-nameserver" not in self.ifaces[currif]: self.ifaces[currif]["dns-nameserver"] = [] - dns_ip = self.convertIP(split[1]) - self.ifaces[currif]["dns-nameserver"].append(dns_ip) - if dns_ip not in self.nameservers: - self.nameservers.append(dns_ip) + for dnsip in split[1:]: + dns_ip = self.convertIP(dnsip) + self.ifaces[currif]["dns-nameserver"].append(dns_ip) + if dns_ip not in self.nameservers: + self.nameservers.append(dns_ip) for ifacename, iface in ifaces.items(): if ifacename in self.ifaces:
Dreambox dm920, Uclan Ustym4Kpro, Gigablue UHD TRIO 4K and Dreambox dm8000. Wavefrontier T55 13.0|19.2|23.5|28.2 + Ziggo.
Posted 27 February 2023 - 13:37
Even with openresolv installed, after restart the file resolv.conf in /var/run is empty.
If i manually put the line "dns-nameservers 192.168.1.1" in interfaces, then after restart all is OK. The file resolv.conf contain:
# Generated by resolvconfnameserver 192.168.1.1
That indeed is the current workaround if you require a fixed DNS.
Posted 27 February 2023 - 15:52
And if I set dns 1.1.1.1 or 8.8.8.8 after restart, gui dns is not saved.
Posted 27 February 2023 - 16:10
It is already clear that the dns change does not work through the gui.It's just not clear why some dns settings through gui work, while others don't.
And even earlier if I chose a wlan then when setting it up, it was suggested to turn off the lan, but now this is not the case.Or is it just me.
Posted 27 February 2023 - 16:13
It is already clear that the dns change does not work through the gui.
It's just not clear why some dns settings through gui work, while others don't.
And now, maybe only for me, when choosing a wlan and setting it up, it does not offer to disable another interface.
Posted 27 February 2023 - 16:23
In the case of dns from dhcp, you don't need to save or read anything and that's why it works.
openresolv is a resolvconf implementation. It will take the DNS information retrieved from dhcp and populate /etc/resolv.conf with it.
For DNS information entered manually, that issue was brought up by WanWizard and is hopefully on the way of being solved now.
( static DNS has to be confgured in /etc/network/interfaces, openresolv will use those too when populating resolv.conf )
Posted 27 February 2023 - 17:10
Edited by Taapat, 27 February 2023 - 17:10.
Posted 27 February 2023 - 17:54
I can't reproduce that, the response here is direct.
root@hd66se:~# time sh -c "opkg update && opkg upgrade" Downloading http://downloads.openpli.org/feeds/openpli-develop/3rd-party-cortexa15hf-neon-vfpv4/Packages.gz. Updated source 'openpli-3rd-party-cortexa15hf-neon-vfpv4'. Downloading http://downloads.openpli.org/feeds/openpli-develop/3rd-party/Packages.gz. Updated source 'openpli-3rd-party'. Downloading http://downloads.openpli.org/feeds/openpli-develop/3rd-party-hd66se/Packages.gz. Updated source 'openpli-3rd-party-hd66se'. Downloading http://downloads.openpli.org/feeds/openpli-develop/all/Packages.gz. Updated source 'openpli-all'. Downloading http://downloads.openpli.org/feeds/openpli-develop/cortexa15hf-neon-vfpv4/Packages.gz. Updated source 'openpli-cortexa15hf-neon-vfpv4'. Downloading http://downloads.openpli.org/feeds/openpli-develop/hd66se/Packages.gz. Updated source 'openpli-hd66se'. Downloading http://downloads.openpli.org/feeds/openpli-develop/picons/Packages.gz. Updated source 'openpli-picons'. No packages installed or removed. real 0m3.334s user 0m2.561s sys 0m0.127s
Edited by neo, 27 February 2023 - 17:56.
Posted 27 February 2023 - 17:57
For example I set dns-dhcp enable:
nameserver 208.67.222.123nameserver 208.67.220.123And after the restart of the gui and a complete reboot the dns does not disappear.And if I set dns 1.1.1.1 or 8.8.8.8 after restart, gui dns is not saved.
Then you've restored a /etc/resolv.conf, or deleted the symlink that is there after a flash and replaced it by a fixed file.
Posted 27 February 2023 - 18:20
I can't reproduce that, the response here is direct.
Edited by Taapat, 27 February 2023 - 18:23.
Posted 1 March 2023 - 18:23
Edited by Mr.Yoshi!, 1 March 2023 - 18:23.
0 members, 2 guests, 0 anonymous users