Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Can't access dnsmasq from other PC on network [SOLVED]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
Robert S
Guru
Guru


Joined: 15 Aug 2004
Posts: 463
Location: Canberra Australia

PostPosted: Wed Nov 23, 2005 12:24 pm    Post subject: Can't access dnsmasq from other PC on network [SOLVED] Reply with quote

I've set up the default dnsmasq installation and have put the following in /etc/conf.d/dnsmasq:
Quote:
DNSMASQ_OPTS="-q -S xxx.xxx.xxx.xxx"
xxx.xxx.xxx.xxx is the IP address of my ISP's nameserver. The log shows that dnsmasq is doing name lookups for my local computer. If I go to another computer on my network and change my /etc/resolv.conf to
Quote:
nameserver 192.168.0.20
(ie the address of my dnsmasq machine), I can't do name lookups (eg. nslookup google.com) because they time out. If I do nmap 192.168.0.20, port 53 is open. If I look in the log of 192.168.0.20, the lookup on the remote machine is not logged.

How do I allow dnsmasq to be used as a nameserver on my network? This is probably (and hopefully) an easy n00b question.


Last edited by Robert S on Thu Nov 24, 2005 8:58 am; edited 1 time in total
Back to top
View user's profile Send private message
magic919
Advocate
Advocate


Joined: 17 Jun 2005
Posts: 2182
Location: Berkshire, UK

PostPosted: Wed Nov 23, 2005 1:43 pm    Post subject: Reply with quote

I think dnsmasq is just not getting the requests. Try running nslookup interactively and select the dnsmasq server by IP (server 192.168.0.20) and then try google.com and see what happens.
Back to top
View user's profile Send private message
Robert S
Guru
Guru


Joined: 15 Aug 2004
Posts: 463
Location: Canberra Australia

PostPosted: Wed Nov 23, 2005 8:42 pm    Post subject: Reply with quote

Still no luck. Remote machine:
Quote:
# nslookup www.google.com 192.168.0.20
;; connection timed out; no servers could be reached
Local machine:
Quote:
robert@athlon ~ $ nslookup www.google.com 192.168.0.20

robert@athlon ~ $ nslookup www.google.com 127.0.0.1
Server: 127.0.0.1
Address: 127.0.0.1#53

Non-authoritative answer:
www.google.com canonical name = www.l.google.com.
Name: www.l.google.com
Address: 72.14.203.99
Name: www.l.google.com
Address: 72.14.203.104
Its obviously not responding to requests to 192.168.0.20. I'm missing something obvious I think. My /etc/dnsmasq.conf:
Quote:

domain-needed
bogus-priv
server=xxx.xxx.xxx.xxx
server=xxx.xxx.xxx.xxx
My /etc/conf.d/dnsmasq is listed above.
Back to top
View user's profile Send private message
think4urs11
Bodhisattva
Bodhisattva


Joined: 25 Jun 2003
Posts: 6659
Location: above the cloud

PostPosted: Wed Nov 23, 2005 8:47 pm    Post subject: Reply with quote

seems to as if you forgot to bind dnsmasq to an interface; insert something like interface=eth0 in its config (asuming eth0 is your internal NIC)
_________________
Nothing is secure / Security is always a trade-off with usability / Do not assume anything / Trust no-one, nothing / Paranoia is your friend / Think for yourself
Back to top
View user's profile Send private message
Robert S
Guru
Guru


Joined: 15 Aug 2004
Posts: 463
Location: Canberra Australia

PostPosted: Thu Nov 24, 2005 12:32 am    Post subject: Reply with quote

I've done that. Still no luck. Could somebody post a working configuration on this forum? Are there any other files not related to dnsmasq that might be relevant? BTW I don't have a firewall running on my machine. I am somewhat mystified by this.
Back to top
View user's profile Send private message
magic919
Advocate
Advocate


Joined: 17 Jun 2005
Posts: 2182
Location: Berkshire, UK

PostPosted: Thu Nov 24, 2005 8:37 am    Post subject: Reply with quote

Can you try to run it interactively to make sure it's not the client as the config etc seems fine.

Type nslookup enter

then server 192.168.0.20 enter

google.com enter

...
Back to top
View user's profile Send private message
slycordinator
Advocate
Advocate


Joined: 31 Jan 2004
Posts: 3065
Location: Korea

PostPosted: Thu Nov 24, 2005 8:43 am    Post subject: Reply with quote

You probably didn't set it up for the box that has dnsmasq installed to do forwarding of packets.

Also you don't need to set up your ISP's DNS servers in dnsmasq. On the box that you've got dnsmasq installed on you just have /etc/resolv.conf have the upstream dns servers.

There's a section for dnsmasq here:
http://gentoo-wiki.com/HOWTO_setup_a_home-server
Back to top
View user's profile Send private message
Robert S
Guru
Guru


Joined: 15 Aug 2004
Posts: 463
Location: Canberra Australia

PostPosted: Thu Nov 24, 2005 8:57 am    Post subject: Reply with quote

The solution was so simple that its embarrassing to put it here ;). Something to do with wrong IP addresses.

As you say - I've just discovered that it works perfectly well straight out of the box with ISP's nameservers in /etc/resolv.conf.

I've trashed djbdns and replaced it with dnsmasq. I'm only using it for a small home network. It doesn't fill my root directory with clutter and is easy for a simple person like me to understand.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum