Modify

Opened 5 years ago

Last modified 4 years ago

#13685 new defect

[ar71xx] uClibc resolver ignores "search" entry from "/etc/resolv.conf"

Reported by: Damian Kaczkowski <damian.kaczkowski+openwrt@…> Owned by: developers
Priority: high Milestone: Chaos Calmer 15.05
Component: base system Version: Trunk
Keywords: Cc:

Description

Hi.

As topic says. uClibc resolver just ignores "search" entry in "/etc/resolv.conf".

Tested on:

To reproduce:

cat /etc/dnsmasq.conf

host-record=test.lan,192.168.1.1

cat /etc/config/dhcp (all defaults)

config dnsmasq
        option domainneeded '1'
        option boguspriv '1'
        option localise_queries '1'
        option rebind_protection '1'
        option rebind_localhost '1'
        option local '/lan/'
        option domain 'lan'
        option expandhosts '1'
        option nonegcache '0'
        option authoritative '1'
        option readethers '1'
        option leasefile '/tmp/dhcp.leases'
        option resolvfile '/tmp/resolv.conf.auto'
        option filterwin2k '0'

config dhcp 'lan'
        option interface 'lan'
        option start '100'
        option limit '150'
        option leasetime '12h'

config dhcp 'wan'
        option interface 'wan'
        option ignore '1'

/etc/init.d/network restart
/etc/init.d/dnsmasq restart

cat /etc/resolv.conf

search lan
nameserver 127.0.0.1

Ping from some lan host:

C:\Users\dk>ping test.lan

Pinging test.lan [192.168.1.1] with 32 bytes of data:
Control-C
^C

Ping from inside OpenWrt router:

root@OpenWrt:~# ping test
ping: bad address 'test'

As you can see dnsmasq knows who is "test.lan" - it resolves to 192.168.1.1.

Shouldn't OpenWrt router try to ping "test" and if this fails append the "search" domain and ping "test.lan"? Why it says "bad address"?

Greets.

ps. Similar problem in ticket -> #10285

Attachments (0)

Change History (3)

comment:1 Changed 5 years ago by Damian Kaczkowski <damian.kaczkowski+openwrt@…>

nslookup from lan host:

C:\Users\dk>nslookup test.lan
Server:  OpenWrt.lan
Address:  10.22.22.254

Name:    test.lan
Address:  192.168.1.1

nslookup from inside router:

root@OpenWrt:~# nslookup test
Server:    127.0.0.1
Address 1: 127.0.0.1 localhost

nslookup: can't resolve 'test': Name or service not known
root@OpenWrt:~# nslookup test.lan
Server:    127.0.0.1
Address 1: 127.0.0.1 localhost

Name:      test.lan
Address 1: 192.168.1.1 test.lan

comment:2 follow-up: Changed 5 years ago by Damian Kaczkowski <damian.kaczkowski+openwrt@…>

nslookup from lan host (ubuntu):

root@nemesis:~# cat /etc/resolv.conf
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
search lan
nameserver 10.22.22.254
root@nemesis:~# nslookup test
Server:         10.22.22.254
Address:        10.22.22.254#53

Name:   test.lan
Address: 192.168.1.1

As you see this one works as it should.

comment:3 in reply to: ↑ 2 Changed 4 years ago by Justin Vallon <JustinVallon@…>

Also happens on AA 12.09.

"Simpler" to reproduce:

1) Edit /etc/resolv.conf (unlink and create a file, or edit one of the /tmp/resolv.conf* files):

nameserver ${Server}
search blahblah

2) tcpdump -n port domain # limit if needed to local traffic
3) ping somehost

client>server: 2+ AAAA? somehost. (26)
server>client: 2 0/0/0 (26)
client>server: 3+ A? somehost. (26)
server>client: 3 0/0/0 (26)

4) Curiously, ping somehost.somewhere is ok:

client>server: 2+ AAAA? somehost.somewhere. (36)
server>client: 2 NXDomain 0/0/0 (36)
client>server: 3+ AAAA? somehost.somewhere.blahblah. (45)
server>client: 3 NXDomain 0/0/0 (45)
client>server: 4+ A? somehost.somewhere. (36)
server>client: 4 NXDomain 0/0/0 (36)
client>server: 5+ A? somehost.somewhere.blahblah. (45)
server>client: 5 NXDomain 0/0/0 (45)

Both somehost. and somehost.somewhere. do not append any search domains (as expected).

Add Comment

Modify Ticket

Action
as new .
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.