I was given the files for a mini linux
, that boots directly into firefox
. It works for all it should be doing, only that I do not get an internet connection.
We have 3 DNS servers in the network, which all work. I can ping them, too. But when trying to ping google.de
or wget google.de
I get a bad address
error.
nslookup google.de
works for some reason.
I tracked the issue down to my resolv.conf
on the booted system not having the same contents as the resolv.conf
that I put into the .iso
file.
I tried understanding all the factors that go into creating and modifying resolv.conf
. I'm not quite sure I got it all, but I definitely didn't find my solution there.
So as a last ditch effort, I tried making the resolv.conf
file immutable using
:~# chattr +i /etc/resolv.conf
When rebuilding and booting again to my surprise my file was renamed to resolv.conf~
and in its place was the same standard file that has been haunting me.
The file contents make me believe it gets the information from the network itself. When starting the .iso
in Virtualbox without internet access, my file is being kept as it is.
I tried changing /etc/dhcp/dhclient.conf
to not get the information from the net, by deleting domain-name-server
and domain-name-search
from the request
part of the file.
Didn't work unfortunately.
I don't have the NetworkManager installed. The iso is based on Ubuntu 14.04.
There is probably vital information missing. I'm happy to provide it.
UPDATE:
I think I found the file that clears resolv.conf
.
It seems to be /usr/share/udhcpc/default.script
#!/bin/sh
# udhcpc script edited by Tim Riker <Tim@Rikers.org>
[ -z "$1" ] && echo "Error: should be called from udhcpc" && exit 1
RESOLV_CONF="/etc/resolv.conf"
[ - n "$broadcast" ] && BROADCAST="broadcast $broadcast"
[ -n "$subnet" ] && NETMASK="netmask $subnet"
case "$1" in
deconfig)
/bin/ifconfig $interface 0.0.0.0
for i in /etc/ipdown.d/*; do
[ -e $i ] && . $i $interface
done
;;
renew|bound)
/bin/ifconfig $interface $ip $BROADCAST $NETMASK
if [ -n "$router" ] ; then
echo "deleting routers"
while route del default gw 0.0.0.0 dev $interface ; do
:
done
metric=0
for i in $router ; do
route add default gw $i dev $interface metric $((metric++))
done
fi
echo -n > $RESOLV_CONF # Start ----------------
[ -n "$domain" ] && echo search $domain >> $RESOLV_CONF
for i in $dns ; do
echo adding dns $i
echo nameserver $i >> $RESOLV_CONF
done
for i in /etc/ipup.d/*; do
[ -e $i ] && . $i $interface $ip $dns
done # End ------------------
;;
esac
exit 0
It's part of the udhcpc
program. A tiny dhcp client, that is part of busybox
Will investigate further.
UPDATE2 AND SOLUTION:
I commented the part out (#Start to #End), that seemingly overwrites the /etc/resolv.conf
file and sure enough. That was the culprit. So an obscure script caused all this trouble.
I changed the question to reflect, what actually needed to be known to solve my problem, so it would be easier to find for people with the same problem and so I could accept an answer.
Thanks for the help here in figuring things out.