[NCLUG] setting up wireless to use dns

Bob Proulx bob at proulx.com
Thu Jul 19 15:12:05 MDT 2007


nclug at iherr.com wrote:
> /sbin/route add -net default gw 192.168.1.1

That looks good by itself.  But additionally can you show the table?

> And here's my "netstat -r" routing table:
> Kernel IP routing table
> Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
> 192.168.1.0     *               255.255.255.0   U         0 0          0 wlan0
> 127.0.0.0       *               255.0.0.0       U         0 0          0 lo
> default         192.168.1.1     0.0.0.0         UG        0 0          0 wlan0

That looks okay to me too.

> And I'm using "dhclient wlan0" to get an IP address from the router.

If that is working then we can assume that you are most of the way to
a fully functional system.

> With only the wireless link connected (i.e., "wlan0" and not the
> built-in "eth0"), I can successfully ping IP addresses inside and
> outside the LAN.

Good.

> I can ssh into the box and out from the box by IP address.

Excellent.

> But I don't have DNS working to resolve hostnames/URLs. My embedded
> linux box is based on a necessary-files-only debian-based filesystem
> that is stored on a small flash drive (the current filesystem usage
> is about 400MB).

Sounds like a lot of fun.  What is the contents of your
/etc/network/interfaces file?

> When eth0 is enabled, it works fine with the current filesystem and
> is able to resolve hostnames, but with wlan0 only enabled, it can't
> resolve hostnames.

What is in /etc/hosts?

> So my question is... what exact files and/or scripts do I need to
> make the DNS resolving work? I've got the following for my
> /etc/resolv.conf:
> 
> search Belkin
> nameserver 192.168.1.1

That search statement is of course bogus but should not be the cause
of your current problems.  But I would fix it just the same.  Either
remove it entirely or correct the domains to search to be valid.

Do you have 'resolvconf' installed?  If not then you might consider
installing and configuring it.  Note that the resolvconf package will
install event driven scripts to dynamically handle changes to the
/etc/resolv.conf file when interfaces are brought online and offline.

Can you ping your that nameserver above?

  ping 192.168.1.1

Can you from another host on the network look up domain names using
that dns server?  This is the bind9 host command (in the bind9-host)
package but there are alternatives with different syntax.  Or you may
need to use one of the other ways to look up names against a specific
dns server.

  host example.com 192.168.1.1

  dig example.com @192.168.1.1 +short

  nslookup example.com 192.168.1.1

Similarly to Stephen I am suspicious that you actually have a dns
server running on 192.168.1.1.  There have been reports of Belkin
routers furnishing this information as part of a dhcp incorrectly.

> The error I get when trying to ping a host by name is as follows:
> 
> ~]# ping www.google.com
> ping: www.google.com: Unknown server error
> ~]#

I know a lot of people use 'ping' to debug dns problems because ping
needs to look up the dns name.  And on MS-Windows that is almost the
only debugging command available.  But on modern operating systems it
is much more direct to use the available dns utilities to look up dns
names and to get more direct information.  Please use host, dig, or
the old nslookup tools instead for this purpose.

Bob



More information about the NCLUG mailing list