Bug 995 - DNS resolution ignores local domain
: DNS resolution ignores local domain
Status: RESOLVED WONTFIX
Product: Connectivity
Networking
: 5.0/(2.2009.51-1)
: All Maemo
: Medium enhancement with 16 votes (vote)
: ---
Assigned To: unassigned
: networking-bugs
:
: community-diablo
:
:
  Show dependency tree
 
Reported: 2007-01-29 20:37 UTC by Marius Gedminas
Modified: 2012-03-25 17:27 UTC (History)
9 users (show)

See Also:


Attachments
Propagate new connection's domain and/or search options to /etc/resolv.conf (535 bytes, text/plain)
2009-11-17 04:43 UTC, Lucas Maneos
Details


Note

You need to log in before you can comment on or make changes to this bug.


Description Marius Gedminas (reporter) 2007-01-29 20:37:35 UTC
When the DHCP server returns a local domain name to be used when resolving
hostnames (option "local-domain"), the Nokia 770 ignores it.

Well, what actually happens is that a 'local yourdomain' appears in
/tmp/resolv.conf.wlan0, but dnsmasq ignores it, so applications which try to
resolve 'localmachine' fail, and the user has to enter the much-longer
'localmachine.yourdomain' hostname by hand.
Comment 1 Michael 2007-07-09 09:22:14 UTC
I can confirm this behavior for N800 ITOS v4.2007.

It should be possible to resolv local domains.
For example: I use a local http/ftp server and accessing these
is very uncomfortable. Now I have to enter "ftp.localdomain.site"
instead of the short "ftp"!
Comment 3 Xavier Jurado 2008-03-19 01:11:55 UTC
If your network DNS server is configured properly with your domain name and
with your local machines names (either manually or via DHCP), commenting the
option "domain-needed" in /etc/dnsmasq.conf should fix this bug.
Comment 4 Andre Klapper maemo.org 2008-10-30 21:55:49 UTC
Michael, Marius,
can you confirm Xavier's comment?
Comment 5 Mark Walker 2008-10-30 22:17:32 UTC
I voted for this bug, and can confirm that Xavier's workaround worked on my
N800.

(In reply to comment #4)
> Michael, Marius,
> can you confirm Xavier's comment?
>
Comment 6 Michael 2008-10-30 23:04:20 UTC
(In reply to comment #4)
> Michael, Marius,
> can you confirm Xavier's comment?
> 

Sorry, but I can't confirm this completely.

I have commented out "domain-needed" in /etc/dnsmasq.conf and reconnected to my
local WLAN-AP. I also rebooted my N800.
Now I can access some of my local hosts without entering the domain. But I
can't access the http interface of my router. The hostname
(whr-hp-g54.mydomain.site) can't be reloved, if I just enter the hostname
without domain.

$ cat /etc/resolv.conf
nameserver 127.0.0.1

$cat /tmp/resolv.conf.wlan0
domain mydomain.site
nameserver 192.168.10.10

$nslookup whr-hp-g54
Server: 127.0.0.1
Address 1: 127.0.0.1 Nokia-N800-23-14

nslookup: can't resolve 'whr-hp-g54'

$nslookup MyPC
Server: 127.0.0.1
Address 1: 127.0.0.1 Nokia-N800-23-14

Name: MyPC
Address 1: 192.168.1.11

Why doesn't nslookup find the hostname of my router (whr-hp-g54)?
Why doesn't nsloopup attach the domain as result of a query (MyPC.mydomain.site
instead of MyPC)?
Comment 7 Lucas Maneos 2008-12-11 22:09:48 UTC
Bug still applies to 4.2008.36-5.

The suggestion in comment #3 can't work, as it simply causes dnsmasq to forward
the request to the upstream server as it was received (without a domain part). 
Eg, in Michael's case the upstream DNS server is asked to resolve 'whr-hp-g54.'
as a top-level domain.  IMO this works as documented, and the domain-needed
option should remain disabled.

An option that could potentially work is:

domain="#"

but this caused a reboot loop when I tried it because dnsmasq didn't like it in
combination with multiple resolv-file entries and kept aborting at startup
causing dsme to eventually reset the device :-(

Another possible solution is to attack this from the resolver library side:
- Make /etc/resolv.conf a symlink to /tmp/resolv.conf
- Create a dummy /tmp/resolv.conf at boot time containing just "nameserver
127.0.0.1" (as the current /etc/resolv.conf)
- Update /tmp/resolv.conf when an IP connection is established (if-up.d
script?) with the domain provided by DHCP, and clean it up when the connection
is terminated.
Comment 8 Lucas Maneos 2009-05-18 11:29:31 UTC
Removing ITOS2007HE-garage keyword to avoid confusion.  This affects all
released maemo versions/devices to date.
Comment 9 Lucas Maneos 2009-07-18 16:00:09 UTC
*** Bug 318 has been marked as a duplicate of this bug. ***
Comment 10 Quim Gil nokia 2009-09-21 09:20:37 UTC
I wonder how similar is this case to Bug 1767 Comment 9
Comment 11 David Hagood 2009-09-24 03:47:10 UTC
Re comment #10: This is not at all similar.

But 1767 #9 is about establishing connections to localhost (127.0.0.1) when no
network connection exists.
Comment 12 Quim Gil nokia 2009-10-14 08:26:17 UTC
Is this problem still present in Maemo 5?

If so, it is a bug or a enhancement request?

If it's a bug then it needs to be filed in the internal bugzilla. 

If it's an enhancement then let's tag it as such.

Thanks!
Comment 13 Lucas Maneos 2009-10-14 11:58:47 UTC
(In reply to comment #12)
> Is this problem still present in Maemo 5?

Yes.  I'm a bit wary of testing workarounds for the time being as there's no
way to recover from a reboot loop before firmware images are available.

> If so, it is a bug or a enhancement request?

Enhancement, in the sense that no standard mandates it. RFC2132:

> 3.17. Domain Name
> 
>  This option specifies the domain name that client should use when
>  resolving hostnames via the Domain Name System.
Comment 14 Quim Gil nokia 2009-10-14 12:26:07 UTC
(In reply to comment #13)
> Yes.  I'm a bit wary of testing workarounds for the time being as there's no
> way to recover from a reboot loop before firmware images are available.

If you Lucas want to test then we can provide an image to restore your system.
It's a please to have a committed contributor like you willing to help fixing
things!
Comment 15 Lucas Maneos 2009-11-17 04:43:27 UTC
Created an attachment (id=1589) [details]
Propagate new connection's domain and/or search options to /etc/resolv.conf

Not much has changed in Fremantle re: dnsmasq after all.  The attached script
takes the resolver approach and simply creates an /etc/resolv.conf file with
the current connection's domain/search options.  It should go into
/etc/network/if-up.d and have execute permissions.
Comment 16 Lucas Maneos 2010-01-07 06:52:27 UTC
Note: in 2.2009.51-1 the resolv.conf.* files have been moved from /tmp to
/var/run.
Comment 17 Martin Jeffreys 2010-05-07 01:06:30 UTC
(In reply to comment #16)

I have the latest release firmware for my N900.
I have placed this script in /etc/network/if-up.d and given it execute
permission.

I have made the change to reading from /var/run/resolv.conf.*

The file /etc/resolv.conf is being created with the only data:
nameserver 127.0.0.1

If I run the other commands of the script manually when my wireless connection
is up, I get the correct out put at each point:
The line which would set RESOLVCONF would sets it to be
/var/run/resolv.conf.wlan0
If I run the command of the IF statement, the correct domain infomation is
appended to /etc/resolv.conf

If I manually enter these commands, the /etc/resolv.conf is populated correctly
and DNS works correctly for me.

What must I have down wrong with the script for it to fail to work
automatically at the time of connection?
Comment 18 Andre Klapper maemo.org 2012-03-24 11:46:53 UTC
The Maemo 5 User Interface and Maemo 5 platform components (e.g. libraries)
used for the N900 are considered stable by Nokia and it seems that there are no
plans for official updates currently, hence nobody plans to work on this
enhancement/wishlist request. 
(And in case you feel like discussing this situation: Nokia Customer Care or
http://talk.maemo.org would be the place to do so as you will not reach Nokia
officials in this community bugtracker - though all of this is really no news.)

Reflecting this status by setting RESOLVED WONTFIX for this
enhancement/wishlist request (see
https://bugs.maemo.org/page.cgi?id=fields.html#status for status explanations).

There is a small chance for issues in those Maemo components that are open
source: Contributed patches could be included and made available in the Maemo 5
Community CSSU updates. 
The Maemo CSSU project is run by a small team of volunteers; see
http://wiki.maemo.org/CSSU for more information.
So in case that you can provide a patch that fixes the reported problem, please
feel encouraged to file a request under
https://bugs.maemo.org/enter_bug.cgi?product=Maemo%205%20Community%20SSU .
Please note: The Maemo CSSU project is not related in any way to Nokia.


( Tag for mass-deleting bugmail: [cleanup20120324] )