OpenWrt Forum Archive

Topic: Unable to resolve hostnames within LAN

The content of this topic has been archived on 23 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hey there

I'm running Backfire on a Fluksometer device in wireless client mode.

I have the problem that only hostnames in the internet are resolved, but not in the LAN:

root@flukso-e5e6a3:~# nslookup google.com
Server:    127.0.0.1
Address 1: 127.0.0.1 localhost

Name:      google.com
Address 1: 74.125.232.104 mil01s07-in-f8.1e100.net
Address 2: 74.125.232.100 mil01s07-in-f4.1e100.net
Address 3: 74.125.232.105 mil01s07-in-f9.1e100.net
Address 4: 74.125.232.103 mil01s07-in-f7.1e100.net
Address 5: 74.125.232.98 mil01s07-in-f2.1e100.net
Address 6: 74.125.232.102 mil01s07-in-f6.1e100.net
Address 7: 74.125.232.97 mil01s07-in-f1.1e100.net
Address 8: 74.125.232.99 mil01s07-in-f3.1e100.net
Address 9: 74.125.232.101 mil01s07-in-f5.1e100.net
Address 10: 74.125.232.96 mil01s07-in-f0.1e100.net
Address 11: 74.125.232.110 mil01s07-in-f14.1e100.net
root@flukso-e5e6a3:~# nslookup orinoco    
Server:    127.0.0.1
Address 1: 127.0.0.1 localhost

nslookup: can't resolve 'orinoco': Name or service not known

On any other client in the LAN this works without any problems. I use the following configuration:

/etc/config/dhcp:

config dnsmasq
        option domainneeded     0
        option boguspriv        0
        option filterwin2k      '0'  #enable for dial on demand
        option localise_queries 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'

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

config dhcp
        option interface        wan
        option ignore   1

/etc/config/network:

config interface loopback
        option ifname   lo
        option proto    static
        option ipaddr   127.0.0.1
        option netmask  255.0.0.0

config interface wan
        option ifname   ath0
        option proto    dhcp
        option hostname flukso

config interface lan
        option ifname   eth0
        option proto    static
        option ipaddr   169.254.59.1
        option netmask  255.255.0.0

Thanks for any advice!

The DNS only Resolves local hosts that he had assigned to Clients in the local network.

cat /tmp/dhcp.leases

maybe you need

/etc/config/dhcp

config 'dnsmasq'
      option 'domainneeded' '1'

(Last edited by draner86 on 23 Apr 2012, 11:23)

Thanks for your reply. The OpenWrt device does not act as DHCP server as it is in client mode only.

option 'domainneeded' '1' does not fix the issue...

go into Luci Network --> DHCP and DNS

Under DNS Forwarding add

/local.net/local DNS IP@169.254.59.1

Rebind protection 1
Allow localhost 1
Domain whitelist lcoal.net

don't know if it works, have a try

(Last edited by draner86 on 23 Apr 2012, 12:06)

I think I should be more precise about the network interfaces...

On the 'lan' interface, a Smart Meter is connected via a crossover cable. This is for power measurements only, not for routing.
On the 'wan' interface, the device is connected via WLAN to a router that acts as the gateway to the internet.

I'm not sure at what your instructions aim for smile
Should I use the gateway address (192.168.1.1) instead of 169.254.59.1?

A problem with this possible solution would be that the device is to be deployed in other networks where the gateway address is not known in advance.

The discussion might have continued from here.