0

I'm on a ubuntu based linux distro (linaro) running xfce. My networkmanager connects to wireless access points, but is unable to do two things:

  • dynamically acquire a nameserver, and write a dynamic /etc/resolv.conf. In fact, it would be great if I could make it do this for some particular networks, and use a standard /etc/resolv.conf on other networks.
  • My browser does not redirect to login pages. Clearly, this has something to do with the nameserver problem.

I checked my /etc/dhcp/dhclient.conf and it has the line request subnet-mask, broadcast-address, time-offset, routers, domain-name, domain-name-servers, domain-search, host-name, netbios-name-servers, netbios-scope, interface-mtu, rfc3442-classless-static-routes, ntp-servers, dhcp6.domain-search, dhcp6.fqdn, dhcp6.name-servers, dhcp6.sntp-servers; So if I run sudo dhclient <network inteface> it rewrites the /etc/resolv.conf file without any trouble. So if I "connect manually" using wpa-supplicant and dhclient, this works perfectly. So I'm guessing it's an issue with network manager. Does network manager not use dhclient? How do I fix this?

1

On my system (ubuntu 14.04), /etc/resolv.conf is created by the package "resolvconf" (is it installed?) and is just a symbolic link to the file ../run/resolvconf/resolv.conf.

The IP address in /etc/resolv.conf is a dummy internal IP. To get the real address of the name server you can use "nm-tool" or "nmcli device list iface eth0".

Which method did you choose in Network-mananger under the IPv4, "Automatic (DHCP)" or "Automatic (DHCP) addresses only". I think you have to use the first one.

What is the version of you linaro system and on which version of ubuntu is it based?

0

It turns out that newer versions of NetworkManager use a program called dnsmasq as a DNS resolver. So even if you delete the /etc/resolv.conf file from your system, NetworkManager will work correctly. In fact, dnsmasq has an explicit option to NOT read resolv.conf. This is what my NetworkManager usually runs it with: dnsmasq --no-resolv It also has a /var/run/nm-dns-dnsmasq.conf file. This is configured using files in the /etc/NetworkManager/dnsmasq.d/ Look at the dnsmasq documentation to learn more about its configuration. It appears to be a fairly powerful tool.

dnsmasq can be disabled by removing the line dns=dnsmasq in the /etc/NetworkManager/NetworkManager.conf file. Then --although I've not tested it-- it ought to default to dhclient, based on what I've read in the NetworkManager documentation.

Another possible problem was that the /etc/NetworkManager/NetworkManager.conf had a line that said [ifupdown] managed=false I changed this to true, and NetworkManager started to work again properly. The newer NetworkManager versions (on precise and later) also tend to pause for 60 or more seconds in the beginning with a waiting for network configuration message during boot. This is usually cause by a syntax error in the /etc/network/interfaces file. I fixed this by having just the following lines in the file auto lo iface lo inet loopback

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.