manual dns don't work

Bug #145405 reported by Antonio on 2007-09-26
60
This bug affects 8 people
Affects Status Importance Assigned to Milestone
wicd
High
Tom Van Braeckel

Bug Description

manual dsn configured, in order to use opendns, but it use standard dns of my isp, thank you.

using ubuntu 7.04

Dan O'Reilly (oreilldf) wrote :

What version of wicd are you using?

Dan O'Reilly (oreilldf) on 2008-01-24
Changed in wicd:
status: New → Incomplete
phys_user (myemail-slopsbox) wrote :

I think that I have a similar problem: i configured a global dns, and when I select connect to the cabled network, it never changes the dns from the dns that I was using in the wireless network. It changes correctly the dns when I am on a cabled network and change to a wireless network.

I use wicd 1.4.1, with debian lenny amd64.

elbistro (elbistro) wrote :

Same problem for me with wicd 1.4.2-1 under Ubuntu Gutsy Gibbon.

I configure global DNS in preferences.

I open a wireless connection to change settings by checking "static DNS" and "use global DNS" then I click on connexion.
If I reopen the same wireless connection settings "static DNS" and "use global DNS" are unchecked.

On first connection the settings are correct with global DNS in /etc/resolv.conf but the second time the DNS in /etc/resolv.conf are defaut access point ones.

Dan O'Reilly (oreilldf) wrote :

I'll take a look at this and make sure it works for the next major release.

Loye Young (loyeyoung) wrote :

This is the downside of fixing Bug 181031.

The problem is not strictly speaking solely a wicd problem: several of the dhcp client applications overwrite /etc/resolv.conf, often in unintended ways. The worst offender is the combination of dhcdbd and network-manager, which silently overrides the system's network configurations.

When I need the /etc/resolv.conf file not to change, I remove the write bit from privileges, which prevents changes by other programs, viz:

# sudo chmod a-w /etc/resolv.conf

Happy Trails,

Loye Young
Isaac & Young Computer Company
Laredo, Texas
http://www.iycc.net

Robby Workman (rworkman) wrote :

This should be fixed in both 1.5.x and 1.6.x, I believe. If I'm wrong, either reopen this bug or file a new one.

Changed in wicd:
status: Incomplete → Fix Released
Brian J. Cohen (brianjcohen) wrote :

I have re-opened this bug, as it still appears to be an issue in 1.6.2.2.

Changed in wicd:
status: Fix Released → Incomplete
José Valecillos (j-valecillos) wrote :

The problem is present in 1.7.0 version too.

Changed in wicd:
status: Incomplete → Confirmed
madskaddie (madskaddie) wrote :

I confirm the bug in the 1.6.1 (installed via Karmic repos.). Strictly speaking, this is not a wicd bug: if I understood correctly from the wicd sources, wicd relies on a external dhcp clientto adquire the dynamic network configuration. In Debian/Ubuntu this client is dhclient. By default, the dhclient config requests DNS information (checkout the "request" line in /etc/dhcp3/dhclient.conf or your distro equivalent). Until the dhclient updates, my DNS config is correct

In order to fix this bug we have to write a good configuration file (which doesn't DNS requests) and pass it through
"dhclient -cf $FILE". I guess the:
"
client_dict = {
            "dhclient" :
                {'connect' : r"%(cmd)s %(iface)s",
                 'release' : r"%(cmd)s -r %(iface)s",
                 'id' : misc.DHCLIENT,
                 },
" @ wnettools.py
must be changed to "'connet': ... -cf %(file)" ....

saygin (sayginb) wrote :

this bug is still present in 1.7.0 in Kubuntu Lucid.

vajorie (vajorie) wrote :

I have the 1.7.0 version on Arch (using dhcpcd) and have this bug as well. I have set DNS servers both globally and for the connection I am using. Is there anything we could do to help resolve this?

welt (n03i) wrote :

you can edit manually in your system. Open Terminal and type:
sudo gedit /etc/resolv.conf

and add or change the line to your individual settings:
nameserver 123.your.personal.DNS

Daniel Derezinski (yp2) wrote :

You can probably bypass this bug by putting shell script in /etc/wicd/scripts/postconnect/ .

sudo nano /etc/wicd/scripts/postconnect/dhcp

paste this:

#!/bin/bash

dhclient

then edit :

sudo nano /etc/dhcp3/dhclient.conf

at the end of file past this:

prepend domain-name-servers DNS-ip;
prepend domain-name-servers DNS-ip;
prepend domain-name-servers DNS-ip;

remember that the last entry in dhclient.conf will by first entry in /etc/resolve.conf - it will by your first DNS.
Reconnect or reboot it would work.

Daniel Derezinski (yp2) wrote :

I forgot to add this:

sudo chmod +x sudo nano /etc/wicd/scripts/postconnect/dhcp

you have to make it executable of course :)

Daniel Derezinski (yp2) wrote :

Ok I figure out it bit.
In Ubuntu 10.04 apparmor is responsible for not allowing to run dhclient with option -cf pointing to /var/lib/wicd/dhclient.conf.

Maybe wicd should run dhclient with default config file for dhcp3 client - /etc/dhcp3/dhclient.conf.

I don't understand why wicd creates it's own dhclinet.conf and try to used it.

Another options here is to write rules for apparmor (/etc/apparmor.d/sbin.dhclient3) with appropriate entries for wicd.

present in Version: 1.7.0+ds1-6 on debian

Using dhcpcd and dhclient

darkfeline (cyberdupo56) wrote :

I'm not sure if this is the same bug, but wicd correctly sets static dns when connecting to a wireless network, but when it renews its dhcp lease, /etc/resolv.conf is overwritten with the dhcp provided dns.

Arch Linux with wicd 1.7.1-2

J.L. (jl2001) wrote :

"wicd correctly sets static dns when connecting to a wireless network, but when it renews its dhcp lease, /etc/resolv.conf is overwritten with the dhcp provided dns." I confirme, ubuntu 11.10

I also confirm that dns is being replaced in a dhcp renew, the DNS configuration works the first time it connects. Wicd needs to prevent the dhcp client from overwriting dns information.

wicd 1.7.1-2

I've created this attached patch. It forwards to the StartDHCP routine that a static dns will be configured, so it can properly tell the dhcp client to avoid rewriting dns information.

 I've fixed it for dhcpcd, which is the dhcp client I use and know, but since each dhcp client has its own commands, I left room to people that uses other clients to change it before applying the patch, by allowing extra parameters to be passed to the dhcp client (have a look at __get_dhcp_command, the 'extra' variable).

Leonardo.

Fix merged and committed. Can you try again, please?

Changed in wicd:
importance: Undecided → High
assignee: nobody → Tom Van Braeckel (tomvanbraeckel)
status: Confirmed → Fix Committed
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers