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



2282 posts

Uber Geek

Trusted
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
1609 posts

Uber Geek


  # 1376202 29-Aug-2015 21:03
One person supports this post
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?

14987 posts

Uber Geek

Trusted
Subscriber

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

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

 
 
 
 


Mr Snotty
8763 posts

Uber Geek

Moderator
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.




mdf



2282 posts

Uber Geek

Trusted
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.

1609 posts

Uber Geek


  # 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



2282 posts

Uber Geek

Trusted
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).

28117 posts

Uber Geek

Moderator
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.





 
 
 
 


3885 posts

Uber Geek

Subscriber

  # 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



2282 posts

Uber Geek

Trusted
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.

28117 posts

Uber Geek

Moderator
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



2282 posts

Uber Geek

Trusted
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



Twitter and LinkedIn »



Follow us to receive Twitter updates when new discussions are posted in our forums:



Follow us to receive Twitter updates when news items and blogs are posted in our frontpage:



Follow us to receive Twitter updates when tech item prices are listed in our price comparison site:





News »

New AI legaltech product launched in New Zealand
Posted 21-Aug-2019 17:01


Yubico launches first Lightning-compatible security key, the YubiKey 5Ci
Posted 21-Aug-2019 16:46


Disney+ streaming service confirmed launch in New Zealand
Posted 20-Aug-2019 09:29


Industry plan could create a billion dollar interactive games sector
Posted 19-Aug-2019 20:41


Personal cyber insurance a New Zealand first
Posted 19-Aug-2019 20:26


University of Waikato launches space for esports
Posted 19-Aug-2019 20:20


D-Link ANZ expands mydlink ecosystem with new mydlink Mini Wi-Fi Smart Plug
Posted 19-Aug-2019 20:14


Kiwi workers still falling victim to old cyber tricks
Posted 12-Aug-2019 20:47


Lightning Lab GovTech launches 2019 programme
Posted 12-Aug-2019 20:41


Epson launches portable laser projector
Posted 12-Aug-2019 20:27


Huawei launches new distributed HarmonyOS
Posted 12-Aug-2019 20:20


Lenovo introduces single-socket servers for edge and data-intensive workloads
Posted 9-Aug-2019 21:26


The Document Foundation announces LibreOffice 6.3
Posted 9-Aug-2019 16:57


Symantec sell enterprise security assets for US$ 10.7 billion to Broadcom
Posted 9-Aug-2019 16:43


Artificial tongue can distinguish whisky and identify counterfeits
Posted 8-Aug-2019 20:20



Geekzone Live »

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


Support Geekzone »

Our community of supporters help make Geekzone possible. Click the button below to join them.

Support Geezone on PressPatron



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.

Alternatively, you can receive a daily email with Geekzone updates.