Geekzone: technology news, blogs, forums
Guest
Welcome Guest.
You haven't logged in yet. If you don't have an account you can register now.


mdf

mdf

mdf
3569 posts

Uber Geek
+1 received by user: 1527

Trusted
Lifetime subscriber

#179168 29-Aug-2015 20:11
Send private message

I've just got a new Raspberry Pi and I've been playing. Current project is trying to set up a local DNS server/cache using DNSMasq (mostly following this guide).

I seem to have gotten it working properly. When I set the DNS server of my local machine to the IP of the Raspberry Pi (192.168.0.40 in my case) everything seems to work fine. Random domains I know I have never used before resolve properly. In testing this I've deleted the external DNS server from my router so I know it's coming from the Pi.

Ideally I'd like the router to use the Pi as its DNS server so everything on the network automatically uses it without me configuring every device manually. However, when I try setting the DNS server on the router to the local IP of the Pi I get DNS errors and sites don't load.

The router is a D-Link DIR-868L. I made a bit of a strategic error when I bought it - I checked the DDWRT router database and saw it was supported so bought it (I did get a good deal). But I didn't read all the forum threads. DDWRT works well on the D-Link as a router (including DNSMasq goodness), but the wireless performance goes right down the tubes so I've flicked back to stock D-Link firmware.

Any ideas?

Create new topic
DarkShadow
1647 posts

Uber Geek
+1 received by user: 656


  #1376202 29-Aug-2015 21:03
Send private message

Instead of setting the DNS of the router to your Pi, have you tried changing the DHCP settings, so it is handing out the address of the Pi as DNS?



timmmay
20923 posts

Uber Geek
+1 received by user: 5395

Trusted
Lifetime subscriber

  #1376206 29-Aug-2015 21:40
Send private message

What are you trying to achieve? Why do you need a pi doing DNS?

michaelmurfy
meow
13665 posts

Uber Geek
+1 received by user: 11069

Moderator
ID Verified
Trusted
Lifetime subscriber

  #1376209 29-Aug-2015 21:55
Send private message

It wouldn't surprise me if your router was already using dnsmasq under the hood and caching DNS already - most routers do. I don't think you'll experience any speed improvements.




Michael Murphy | https://murfy.nz
Referral Links: Quic Broadband (use R122101E7CV7Q for free setup)

Are you happy with what you get from Geekzone? Please consider supporting us by subscribing.
Opinions are my own and not the views of my employer.




mdf

mdf

mdf
3569 posts

Uber Geek
+1 received by user: 1527

Trusted
Lifetime subscriber

  #1376213 29-Aug-2015 22:16
Send private message

DarkShadow: Instead of setting the DNS of the router to your Pi, have you tried changing the DHCP settings, so it is handing out the address of the Pi as DNS?


Sorry, not sure I follow this one. You mean using the Pi as a DCHP server too? I tried that but it caused some issues trying to sort out the double NAT was beyond me.

 

What are you trying to achieve? Why do you need a pi doing DNS?


Few things. Learning something new was a big part of it. But also trying to better utilise some of the smarter things you can do with DNS - geo-unblocking and adblocking. And possibly setting up local domain names would be useful too. I might eventually try squid and/or privoxy too.

DarkShadow
1647 posts

Uber Geek
+1 received by user: 656


  #1376215 29-Aug-2015 22:25
Send private message

mdf:
DarkShadow: Instead of setting the DNS of the router to your Pi, have you tried changing the DHCP settings, so it is handing out the address of the Pi as DNS?


Sorry, not sure I follow this one. You mean using the Pi as a DCHP server too? I tried that but it caused some issues trying to sort out the double NAT was beyond me.



No, when your router gives out DHCP replies, it will usually tell the clients to use itself as the DNS. You want to set it so that it tell the clients to use your Pi as the DNS.

mdf

mdf

mdf
3569 posts

Uber Geek
+1 received by user: 1527

Trusted
Lifetime subscriber

  #1376220 29-Aug-2015 22:42
Send private message

DarkShadow:
mdf:
DarkShadow: Instead of setting the DNS of the router to your Pi, have you tried changing the DHCP settings, so it is handing out the address of the Pi as DNS?


Sorry, not sure I follow this one. You mean using the Pi as a DCHP server too? I tried that but it caused some issues trying to sort out the double NAT was beyond me.



No, when your router gives out DHCP replies, it will usually tell the clients to use itself as the DNS. You want to set it so that it tell the clients to use your Pi as the DNS.


If my router has that setting, I can't find it.

I might be able to do something with network filtering, but that will require more experimentation than 11 o'clock on a Saturday night allows.

EDIT: Gaah! Geekzone is doing that thing where it won't let me upload images. Can anyone remind me how to get it back (browser refresh and cache clearing didn't work).

 
 
 
 

Shop now for Dyson appliances (affiliate link).
sbiddle
30853 posts

Uber Geek
+1 received by user: 9998

Retired Mod
Trusted
Biddle Corp
Lifetime subscriber

  #1376257 30-Aug-2015 08:20
Send private message

Maybe you could explain what you're actually trying to accomplish. 99% of routers already run DNSMasq (or similar packages) so I'm not sure why you're trying to reinvent the wheel on your network.

The vast majority of routers are also not going to allow you to specify specific DHCP server settings when they are handling the local DHCP. If you want to use a different DNS server along with DHCP served from your router on your network you'll probably need to go out and buy something more than a cheap consumer grade router, ie something like a Cisco or a Mikrotik will give you full granular control over the DHCP settings.





Aredwood
3885 posts

Uber Geek
+1 received by user: 1749


  #1376416 30-Aug-2015 14:43

Have you done any DNS speed tests? Here is a program that does that https://www.grc.com/dns/benchmark.htm Also in Windows, the order that DNS servers are listed is important as well. As windows will always use the first one in the list and will only use the others if the first one stops working. So if the first one in the list is also the slowest one, then your DNS will be slow.  This also means you can add the Google DNS servers to the bottom of the list and you then have automatic DNS failover.





mdf

mdf

mdf
3569 posts

Uber Geek
+1 received by user: 1527

Trusted
Lifetime subscriber

  #1376527 30-Aug-2015 18:45
Send private message

sbiddle: Maybe you could explain what you're actually trying to accomplish. 99% of routers already run DNSMasq (or similar packages) so I'm not sure why you're trying to reinvent the wheel on your network.

The vast majority of routers are also not going to allow you to specify specific DHCP server settings when they are handling the local DHCP. If you want to use a different DNS server along with DHCP served from your router on your network you'll probably need to go out and buy something more than a cheap consumer grade router, ie something like a Cisco or a Mikrotik will give you full granular control over the DHCP settings.



I'm trying to accomplish a few different things. One is just learning something new. But for these purposes let's say I want to adblock and geo-unblock at my home network level, rather than doing it computer by computer. I've done this successfully previously using DDWRT, but while my current router does run DDWRT, the wireless performance is terrible (OpenWRT isn't supported, and Tomato apparently has similar wireless issues). Hence trying it with a Pi. As I say, I've set up the Pi to do this successfully, but there's no point manually pointing each individual device at a local DNS server. I want this to happen automatically.

ARedwood: Have you done any DNS speed tests? Here is a program that does that https://www.grc.com/dns/benchmark.htm Also in Windows, the order that DNS servers are listed is important as well. As windows will always use the first one in the list and will only use the others if the first one stops working. So if the first one in the list is also the slowest one, then your DNS will be slow.  This also means you can add the Google DNS servers to the bottom of the list and you then have automatic DNS failover.


I haven't used DNS Benchmark, but I've used namebench before (and for anyone considering namebench, the "5 spare minutes" it suggests it takes it *waaay* off. It took me about 45). I've also experimented with dig. My router does indeed seem to cache DNS requests, but the cache size seems limited as it quickly goes back to querying the external DNS servers.

I'm less concerned about speed than smarts though.

sbiddle
30853 posts

Uber Geek
+1 received by user: 9998

Retired Mod
Trusted
Biddle Corp
Lifetime subscriber

  #1376551 30-Aug-2015 19:09
Send private message

mdf:

I'm trying to accomplish a few different things. One is just learning something new. But for these purposes let's say I want to adblock and geo-unblock at my home network level, rather than doing it computer by computer. I've done this successfully previously using DDWRT, but while my current router does run DDWRT, the wireless performance is terrible (OpenWRT isn't supported, and Tomato apparently has similar wireless issues). Hence trying it with a Pi. As I say, I've set up the Pi to do this successfully, but there's no point manually pointing each individual device at a local DNS server. I want this to happen automatically.


Your options are either

- configure static IP's on each PC so you can manually configure the DNS
- buy hardware that supports full control over the DHCP scope and settings so you can set the DNS server handed out to something other than the router



mdf

mdf

mdf
3569 posts

Uber Geek
+1 received by user: 1527

Trusted
Lifetime subscriber

  #1376581 30-Aug-2015 19:58
Send private message

sbiddle:
mdf:

I'm trying to accomplish a few different things. One is just learning something new. But for these purposes let's say I want to adblock and geo-unblock at my home network level, rather than doing it computer by computer. I've done this successfully previously using DDWRT, but while my current router does run DDWRT, the wireless performance is terrible (OpenWRT isn't supported, and Tomato apparently has similar wireless issues). Hence trying it with a Pi. As I say, I've set up the Pi to do this successfully, but there's no point manually pointing each individual device at a local DNS server. I want this to happen automatically.


Your options are either

- configure static IP's on each PC so you can manually configure the DNS
- buy hardware that supports full control over the DHCP scope and settings so you can set the DNS server handed out to something other than the router




Boo! :(

I've long since realised I backed the wrong horse on the D-Link. Though it's wireless performance is stellar. Lesson learned for next time. It's not enough of a priority to be upgrading now though - I can do most of what I want through other means.

It was a useful learning experience though. I took one look at RouterOS a couple of years back and decided it was way out of my league. Now having fiddled with the Pi it doesn't look quite so intimidating. Though I have to say with the Pi there is something really liberating about knowing that it's virtually impossible to brick. Operating systems on SD cards should be adopted everywhere.

Create new topic








Geekzone Live »

Try automatic live updates from Geekzone directly in your browser, without refreshing the page, with Geekzone Live now.



Are you subscribed to our RSS feed? You can download the latest headlines and summaries from our stories directly to your computer or smartphone by using a feed reader.