resolv.conf overwritten no matter what I do
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
network-manager (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
Although it works perfectly in Windows, in Kubuntu I need to put the DNS servers in /etc/resolv.conf. Otherwise, it will be overwritten by DHCP with the value:
nameserver 192.168.1.1
which doesn't work.
I prevented /etc/resolv.conf from being overwritten by modifying /etc/dhcp3/
prepend domain-name-servers "212.158.248.6 83.146.21.5";
#supersede domain-name-servers "212.158.248.6 83.146.21.5";
request subnet-mask, broadcast-address, time-offset, routers,
domain-name, host-name, netbios-
However, after a recent update in Edgy, that doesn't work anymore and resolv.conf is being overwritten all the time. I am using Knetworkmanager to connect to a wireless network.
I had to comment out the following in /sbin/dhclient- script to prevent resolv.conf from being overwritten:
# make_resolv_conf() { name_servers" ]; then |*,ro|* ,ro,*)
# if [ -n "$new_domain_name" -o -n "$new_domain_
# # Find out whether we are going to mount / rw
# exec 9>&0 </etc/fstab
# rootmode=rw
# while read dev mnt type opts dump pass junk; do
# [ "$mnt" != / ] && continue
# case "$opts" in
# ro|ro,*
# rootmode=ro
# ;;
# esac
# done
# exec 0>&9 9>&-
# # Wait for /etc/resolv.conf to become writable
# if [ "$rootmode" = "rw" ]; then
# while [ ! -w /etc ]; do
# sleep 0.1
# done
# fi
# local new_resolv_ conf=/etc/ resolv. conf.dhclient- new ]*(search| domain) ' /etc/resolv.conf >> $new_resolv_conf name_servers" ]; then name_servers; do [Aa][Mm] [Ee][Ss] [Ee][Rr] [Vv][Ee] [Rr]/p /etc/resolv.conf >>$new_resolv_conf /etc/resolv. conf $new_resolv_conf /etc/resolv. conf $new_resolv_conf
# rm -f $new_resolv_conf
# if [ -n "$new_domain_name" ]; then
# echo search $new_domain_name >>$new_resolv_conf
# else # keep 'old' search/domain scope
# egrep -i '^ *[:space:
# fi
# if [ -n "$new_domain_
# for nameserver in $new_domain_
# echo nameserver $nameserver >>$new_resolv_conf
# done
# else # keep 'old' nameservers
# sed -n /^\w*[Nn]
# fi
# chown --reference=
# chmod --reference=
# mv -f $new_resolv_conf /etc/resolv.conf
# fi
# }
What an awful hack...