sudo: unable to resolve host dhcppc0

Bug #586794 reported by Omer Akram
28
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Connection Manager
Fix Released
Undecided
Unassigned
Network Menu
Fix Released
Undecided
Unassigned
connman (Ubuntu)
Fix Released
Low
Unassigned

Bug Description

installing network indicator renames the host name to dhcppc0 and also when sudo is used it says 'sudo: unable to resolve host dhcppc0' although the function is completed but there is a delay if the internet is not responding.

Related branches

Revision history for this message
Kalle Valo (kvalo) wrote :

Now this is a weird problem. I assume dhcp client sets this "dhcppc0" address in cases where hostname is bad, missing or similar. I don't see this with my two laptops, but I'm guessing this is somehow related to the dhcp server.

I'll find from the code where this dhcppc0 hostname is set, but in the mean time I have few questions which would help to reproduce the problem:

* what dhcp client are you using, the default from lucid? dpkg -l '*dhcp*' helps here
* what kind of network setup? ethernet, wifi? anything special?
* what's the dhcp server? usually it's in the wireless router
* what is the original hostname (before dhcppc0 is set)?

Revision history for this message
Omer Akram (om26er) wrote :

I am using Maverick but before upgrade the problem was there too.

1. dhcp client is the default version.
2. I am using wifi.
3. see screenshot
4. it was om26er-netbook

Revision history for this message
Kalle Valo (kvalo) wrote :

I checked the dhcp client sources (dhcp-client 3.1.3-2ubuntu3) and I didn't find anything related to setting dhcppc0 (or similar) hostname. So I suspect dhcp server provides the hostname in the dhcp offer and connman currently sets that as the hostname without any checks of whatsoever.

I think this part needs improvement. In some cases it makes sense to change the hostname, but in most of cases the hostname should not be changed at all. Also the fact that connman does not set the search list in resolv.conf might affect here.

I created a test package of connman which does not set the hostname at all:

https://launchpad.net/~kvalo/+archive/ppa/+files/connman_0.53+dfsg-0ubuntu0.10.04.1~ind1~bug586794-1_amd64.deb
https://launchpad.net/~kvalo/+archive/ppa/+files/connman_0.53+dfsg-0ubuntu0.10.04.1~ind1~bug586794-1_i386.deb

Please test and provide feedback.

Revision history for this message
Benjamin Humphrey (humphreybc) wrote :

Kalle,

That .deb package of connman fixed the issue for me.

Revision history for this message
Omer Akram (om26er) wrote :

Fixed

Revision history for this message
Kalle Valo (kvalo) wrote :

Cool, thank you both of you for very quick tests!

So it's now obvious that a quick fix is just to ignore the hostname from dhcp. Longer term fix might be to set hostname only in very special cases, but that needs a lot more thought and is still risky. If someone has opinions or use cases for using the hostname from dhcp offers, I would gladly hear about them.

Changed in connman (Ubuntu):
importance: Undecided → Low
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package connman - 0.54+dfsg-0ubuntu1

---------------
connman (0.54+dfsg-0ubuntu1) maverick; urgency=low

  * New upstream version
  * debian/patches/0001-dhcp-don-t-set-hostname.patch:
    - change by Kalle Valo to not set dhcp hostname (lp: #586794)

  [ Mathieu Trudel ]
  * update get-orig-source/GET_SOURCE code snippets to deal with dfsg,
    as well as alternate branches.
    - update debian/rules

  [ Chris Coulson ]
  * Add patch from Kalle Valo to set default interface if no gateway is found
    - add debian/patches/02-set-default-interface-if-no-ga.patch
    - update debian/patches/series
  * Build with --enable-ofono and drop --enable-hso
    - update debian/rules
 -- Sebastien Bacher <email address hidden> Mon, 28 Jun 2010 17:52:05 +0200

Changed in connman (Ubuntu):
status: New → Fix Released
Kalle Valo (kvalo)
Changed in indicator-network:
status: New → Fix Released
Kalle Valo (kvalo)
Changed in connman:
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.