-
Notifications
You must be signed in to change notification settings - Fork 153
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Malformed resolv.conf breaks networking (multiple dns servers) #534
Comments
You are entirely correct, that is a bug. 👍 You can either have:
or
but this code generates
which is incorrect. |
It previously wrote "nameserver dns-server-1 nameserver dns-server-2" into /etc/resolv.conf, which is incorrect. Thanks to ajones11235 for spotting the error and suggesting a fix. Closes debian-pi#534 Signed-off-by: Diederik de Haas <[email protected]>
I've now pushed 2 commits to the Please do (also) test a mix of f.e. hardcoded ipv4 and dhcp for ipv6. |
Wow, what an amazing response. I run Fedora here. Should I assume it has to be built in a debian VM? If you could point me to any useful tutorials / lists of required tools to help me through the process I would be grateful |
From that I assumed you already (re-)build the installer yourself. Sorry. I can (and probably will) provide a fresh build on my personal clone, but it shouldn't be too hard. There's a good chance it'll run on Fedora as well, but I do use Debian. The procedure is as follows:
|
I published it here: https://github.com/diederikdehaas/raspbian-ua-netinst/releases/tag/v1.1.8-alpha |
Just to reassure that I am working on it. I hope to have test results for the resolv.conf fix by the end of the day. FWIW at first it didn't build on my Fedora box, failing as shown below: . $ ls -l tmp/etc/rmt $ ls -l /usr/sbin/rmt I changed line 389 of build.sh to: |
There is no rush, take your time. When you respond I get an email notification so I know there's potentially something to do.
I run the (build and) install on a regular basis and have installed apt-cacher-ng in my LAN which caches a whole bunch of (deb) packages. It could possibly work on Fedora too; otherwise there's probably some (caching) proxy which could help.
Nice :-)
Interesting 👍 |
Oeps, error on my part. There is no bug in the Debian package, I checked the wrong path. |
OK, so this isn't as easy as I hoped. I have run some tests with minimal builds and while it works with my use case and the (I guess) most common use case there are still some cases where it fails completely.
Test 1 (ipv4: i fixed dns ipv6: dhcp)Works OK but busybox resolv.conf has redundant lines installer-config.txt
/etc/resolv.conf (busybox)
/etc/resolve.conf (raspbian)
Test 2 (ipv4: 2 fixed dns. ipv6: dhcp)Installation proceeded to completion but network did not come up on reboot installer-config.txt
/etc/resolv.conf (busybox)
/etc/resolve.conf (raspbian)
/var/log/syslog
/etc/network/interfaces
Test 3 (ipv4: 2 fixed dns. ipv6: disable)Failed installer-config.txt
/etc/resolv.conf (busybox)zero bytes Test 4 (ipv4: dhcp. ipv6: disable)Worked OK installer-config.txt
/etc/resolv.conf (busybox)
/etc/resolv.conf (raspbian)
Test 4 (ipv4: dhcp. ipv6: disable)Worked OK installer-config.txt
/etc/resolv.conf (busybox)
/etc/resolv.conf (raspbian)
Test 5 (ipv4: dhcp, ipv6: dhcp)Failed very quickly installer-config.txt
No busybox resolv.conf raspbian-ua-netinst-19700101T000023.log
|
I haven't forgotten about this issue. But I've been busy with other things and concluded that I really need some hands on experience with IPv6, which is one of the reasons I'm now learning how to 'hack' my router. |
First - thank you for the great utility. I have found it immensely useful.
Second - Apologies, I ran into this bug ages ago when building a load of raspberry pi 1bs with version 1.1.2 and found a workaround without really understanding the problem and didn't bother to report it. I am now re-building them with version 1.1.7 and this time I can't usefully use the workaround.
If there are multiple DNS servers specified, either hard coded or by dhcp, all the entries for nameserver appear on the same line in /etc/resolv.conf.
Last time I was using hard coded 1pv4 addressing so reducing the number of dns servers in installer-config.txt to one made it work.
This time I am using hard coded ipv4 and dhcp ipv6 addressing, which results in having the ipv4 nameserver address plus some ipv6 addresses from dhcp.
On starting up the system the messages saying it couldn't connect to a time server appeared and rapidly scrolled off the screen
Later it reached and failed at this point:
**P: Retrieving Release
E: Couldn't download Release!
Oh noes! something went wrong!
Output of '/busybox free -k'
.
. (too much typing)
.
You have 10 seconds to hit ENTER to get a shell...**
Hitting enter a couple of times opened BusyBox v1.30.1 (Raspbian 1:1.30.1-4 built in shell (csh)
From there pinging any device by name failed
However pinging by ip address (ipv4 or ipv6) worked.
While in busybox I edited resolv.conf to add some newlines and ping by name worked just fine (both ipv4 and ipv6)
Also while in busybox I eventually discovered the file /etc/init.d/rcS
In that file there are some lines of the form
printf '%s' 'some value' >> resolv.conf
I think they should be
printf '%s\n' 'some value' >> resolv.conf
(Sorry if this is a bit vague. It's all from memory as it all disappeared when I shut down the box)
I added some \ns where it seemed appropriate but was unable to restart the network so I don't know if that solved the problem.
I couldn't work out where in your distribution that file is stored so I have reached a standstill.
If you could tell me how to patch that file I would be very happy to test it for you.
Thanks again for taking the trouble to make and maintain such a useful utility
The text was updated successfully, but these errors were encountered: