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



1552 posts

Uber Geek
+1 received by user: 396

Trusted
Subscriber

Topic # 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
1337 posts

Uber Geek
+1 received by user: 474


  Reply # 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?

13238 posts

Uber Geek
+1 received by user: 2215

Trusted
Subscriber

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

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




AWS Certified Solution Architect Professional, Sysop Administrator Associate, and Developer Associate
TOGAF certified enterprise architect
Professional photographer


 
 
 
 


6798 posts

Uber Geek
+1 received by user: 3132

Moderator
Trusted
Subscriber

  Reply # 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
Want to be with an epic ISP? Want $20 to join them too? Well, use this link to sign up to BigPipe!
The Router GuideCommunity UniFi Cloud Controller | Ubiquiti Edgerouter Tutorial


mdf



1552 posts

Uber Geek
+1 received by user: 396

Trusted
Subscriber

  Reply # 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.

1337 posts

Uber Geek
+1 received by user: 474


  Reply # 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



1552 posts

Uber Geek
+1 received by user: 396

Trusted
Subscriber

  Reply # 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).

25576 posts

Uber Geek
+1 received by user: 5356

Moderator
Trusted
Biddle Corp
Subscriber

  Reply # 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.





1966 posts

Uber Geek
+1 received by user: 628

Subscriber

  Reply # 1376416 30-Aug-2015 14:43
Send private message

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



1552 posts

Uber Geek
+1 received by user: 396

Trusted
Subscriber

  Reply # 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.

25576 posts

Uber Geek
+1 received by user: 5356

Moderator
Trusted
Biddle Corp
Subscriber

  Reply # 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



1552 posts

Uber Geek
+1 received by user: 396

Trusted
Subscriber

  Reply # 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 »

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 »

UFB killer app: Speed
Posted 17-Nov-2017 17:01


The case for RSS — MacSparky
Posted 13-Nov-2017 14:35


WordPress and Indieweb: Take control of your online presence — 6:30 GridAKL Nov 30
Posted 11-Nov-2017 13:43


Chorus reveals technology upgrade for schools, students
Posted 10-Nov-2017 10:28


Vodafone says Internet of Things (IoT) crucial for digital transformation
Posted 10-Nov-2017 10:06


Police and Facebook launch AMBER Alerts system in NZ
Posted 9-Nov-2017 10:49


Amazon debuts Fire TV Stick Basic Edition in over 100 new countries
Posted 8-Nov-2017 05:34


Vodafone VoIP transition to start this month
Posted 7-Nov-2017 12:33


Spark enhances IoT network capability
Posted 7-Nov-2017 11:33


Vocus NZ sale and broadband competition
Posted 6-Nov-2017 14:36


Hawaiki reaches key milestone in landmark deep-sea fibre project
Posted 4-Nov-2017 13:53


Countdown launches new proximity online shopping app
Posted 4-Nov-2017 13:50


Nokia 3310 to be available through Spark New Zealand
Posted 4-Nov-2017 13:31


Nest launches in New Zealand
Posted 4-Nov-2017 12:31


Active wholesale as Chorus tackles wireless challenge
Posted 3-Nov-2017 10:55



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.

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