Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Raspberry Pi as (Local) DNS Server
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

Raspberry Pi as (Local) DNS Server

I just ordered another Raspberry Pi, which i'm planning to use as a local DNS server to block ads on websites on all computers/phones/tablets in our house

But i was wondering if anyone else is doing this, and can it handle the amount of request to the dns server with about 8-10 devices connected at the same time?

Would be great if you could share some experience

«1

Comments

  • DavidxDavidx Member
    edited January 2014

    I think it'd be incredibly slow.. the Raspberry's network isn't very good right? Whenever I used it for an AP it'd be miserable.

  • Yeah the PI should be fine if you only have 10 devices.

  • @David_P said:
    I think it'd be incredibly slow.. the Raspberry's network isn't very good right? Whenever I used it for an AP it'd be miserable.

    Network is fine if you're using ethernet (CAT5e here), used another RPi as a media server/player and I could transfer movies with about 9-10mb/sec to the RPi

    Using a WiFi adapter (used a 300Mbps TP-Link one) will suck, about 2-3 mb/sec max

    So network will not be a problem i guess, i was more worried about the CPU

  • MassNodesMassNodes Member
    edited January 2014

    @joodle said:

    CPU shouldn't be an issue unless your taking in a big amount of DNS requests. 10 client's wouldn't be enough to overwhelm the CPU.

  • jhjh Member

    Why not just use a local hosts file?

  • MassNodesMassNodes Member
    edited January 2014

    @jhadley said:
    Why not just use a local hosts file?

    The early 80s are calling you.

    Thanked by 1darkshire
  • This is what I use my rpi for at home. No issues with it at all, you'll be just fine @joodle

  • @jhadley said:
    Why not just use a local hosts file?

    Lol..... that would be very time consuming every time i need to update the list of blocked websites/advertisers etc

  • jhjh Member

    joodle said: Lol..... that would be very time consuming every time i need to update the list of blocked websites/advertisers etc

    There are lists you can just download and stick in there

  • @jhadley said:
    There are lists you can just download and stick in there

    I know, but updating the host file on the computers will take a lot of time, and how would you do that on android devices (if they are not rooted)?

    Running a DNS server is much quicker (currently hosting one on a VPS in NL)

  • @joodle said:
    I just ordered another Raspberry Pi, which i'm planning to use as a local DNS server to block ads on websites on all computers/phones/tablets in our house

    But i was wondering if anyone else is doing this, and can it handle the amount of request to the dns server with about 8-10 devices connected at the same time?

    Your Pi will do great for that. I had one Pi running in my LAN for local DNS, Postfix+Curier-IMAP and Lighttpd+WebDAV and it could handle all that. And I had it running PiBang Linux that comes with a GUI. The Pi is very much underestimated.

  • @joodle The Pi will do fine.

  • painfreepcpainfreepc Member
    edited January 2014

    MaraDNS proudly serves you 46299 DNS records

    if you have problems with limited Raspberry Pi's resources, give Maradns a try.

    i am ubuntu 12.04/13.04

    "mararc" config file

    bind_address = "192.168.0.200" # ip of server it's running on
    chroot_dir = "/etc/maradns/"
    csv2 = {}
    csv2["."] = "zones/db.nogoodniks" # create folder "zones" , create file "db.nogoodniks"
    random_seed_file = "/etc/maradns/secret"
    # Recursive ACL: Who is allowd to perform recursive queries, you can use ip range.
    # recursive_acl = "127.0.0.1/8,192.168.0.0/16" # can add many ip's
    recursive_acl = "192.168.0.1/16"
    notthere_ip = "xxx.xxx.xxx.xxx" # <--- custom 404 page (nxdomain)
    maximum_cache_elements = 20000 # Max is 25000
    maxprocs = 96
    maradns_uid = xxx
    maradns_gid = xxx
    no_fingerprint = 1
    max_chain = 8
    max_ar_chain = 1
    max_total = 20
    verbose_level = 0 # 3
    timeout_seconds = 1
    # Add DNS Servers Below (you may use root DNS servers if you wish, see below.)
    upstream_servers = {}
    upstream_servers["."] = "8.8.8.8,4.2.2.4" # can even send to 2nd local dns server, like "unbound"
    #root_servers = {} # http://www.iana.org/domains/root/servers
    #root_servers["."] = "192.33.4.12,192.228.79.201,199.7.91.13" # 3 fastest for my location
    

    "db.nogoodniks" config file

    ################### pgl.yoyo.org ###################
    # ===================================================== #
    # Ad server list for use with hosts files to block ads
    #
    # For more information about this list, see: http://pgl.yoyo.org/adservers/
    # ----
    # last updated:   Mon, 20 Jan 2014 13:06:17 GMT
    # entries:        2525
    # format:         hosts (hosts -- in hosts file format)
    # credits:        Peter Lowe - [email protected] - http://pgl.yoyo.org/
    # this URL:       http://pgl.yoyo.org/adservers/serverlist.php?hostformat=hosts;showintro=0
    # other formats:  http://pgl.yoyo.org/adservers/formats.php
    #
    # i use 0.0.0.0 you can use 127.0.0.1 or send to any ip
    101com.com.      +14400  A 0.0.0.0 ~
    101order.com.      +14400  A 0.0.0.0 ~
    103bees.com.      +14400  A 0.0.0.0 ~
    123found.com.      +14400  A 0.0.0.0 ~
    123pagerank.com.      +14400  A 0.0.0.0 ~
    180hits.de.      +14400  A 0.0.0.0 ~
    180searchassistant.com.      +14400  A 0.0.0.0 ~
    180solutions.com.      +14400  A 0.0.0.0 ~
    1x1rank.com.      +14400  A 0.0.0.0 ~
    207.net.      +14400  A 0.0.0.0 ~
    *.207.net.      +14400  A 0.0.0.0 ~ # <-- yes you can do wild card
    247media.com.      +14400  A 0.0.0.0 ~
    24log.com.      +14400  A 0.0.0.0 ~
    24log.de.      +14400  A 0.0.0.0 ~
    24pm-affiliation.com.      +14400  A 0.0.0.0 ~
    
  • painfreepcpainfreepc Member
    edited January 2014

    @skagerrak said: The Pi is very much underestimated.

    it's not that the pi is underestimated, the problem is they see:

    "700 MHz Low Power ARM1176JZ-F Applications Processor"

    and think 700 MHz can't do any thing and that's not true.

  • BlazeMuisBlazeMuis Member
    edited January 2014

    Can't wait till my RPi comes xD

    Just installed a network switch in my room connected to the 2nd router on the attic so that my Pi has ethernet instead of WiFi (Yes, all network ports are already used on the router :P). Router is currently being powered by PoE, love it :)

    I also just got a 2.1A Philips 2 port USB power adapter, should be enough to power the RPi i hope

    Also got a Sandisk Ultra 16GB SDHC UHS-I 30MB/s Class 10x card, which i hope must be enough to have a decent fast RPi

    Edit, Just found out that i'm i need of another ethernet cable... i'm all out of cables damnit. Back to the shop once again..

  • @joodle said:
    Can't wait till my RPi comes xD

    Just installed a network switch in my room connected to the 2nd router on the attic so that my Pi has ethernet instead of WiFi (Yes, all network ports are already used on the router :P). Router is currently being powered by PoE, love it :)

    I also just got a 2.1A Philips 2 port USB power adapter, should be enough to power the RPi i hope

    Also got a Sandisk Ultra 16GB SDHC UHS-I 30MB/s Class 10x card, which i hope must be enough to have a decent fast RPi

    Edit, Just found out that i'm i need of another ethernet cable... i'm all out of cables damnit. Back to the shop once again..

    Sounds awesome. I love my RasPi's (I have four at my house), and I use them for a heap of purposes!

  • Just got 2 new CAT5e cables, on the box it says that it's capable of up to 350Mbps.. On our media computer with a gbit port we can transfer movies at around 80-90 MB/s (5400 RPM drive must be the bottleneck here) using the same CAT5e cables

    Isn't that just weird..

  • @joodle
    350Mbps is equal to 43.75MBps

    The limit of a full gbit port is only 125MB/s, so its not really that weird?

  • rds100rds100 Member
    edited January 2014

    @joodle are you sure it says 350Mbps and not 350MHz?

  • BlazeMuisBlazeMuis Member
    edited January 2014

    @rds100 said:
    joodle are you sure it says 350Mbps and not 350MHz?

    It says 350 Mbit

    Photo: http://imgur.com/5CAyIUb

  • Maybe it came with a router or something, and the router is "up to 350Mbit"? A cable "up to 350Mbit" means nothing.
    And on top of that "350Mbit" is a measure of file size, not of transmission speed :) For speed it should have been "350Mbps" :)

  • BlazeMuisBlazeMuis Member
    edited January 2014

    rds100 said: Maybe it came with a router or something, and the router is "up to 350Mbit"? A cable "up to 350Mbit" means nothing.

    It's just a box with a cable, nothing more lol

    Anyway, my RPi just arrived, only thing to do is flashing Raspbian :) Photo of the setup: http://imgur.com/9RU7I3C

  • @joodle
    The # of devices doesn't really say how many requests/s your pi will be using.

    It's not like they take any considerable amount of cpu, what makes you think that the pi wouldn't be able to pull this off?
    I really want to hear your answer.

  • duckeeyuck said: what makes you think that the pi wouldn't be able to pull this off? I really want to hear your answer.

    I thought that the CPU would be a bottleneck

  • duckeeyuckduckeeyuck Member
    edited January 2014

    joodle said: I thought that the CPU would be a bottleneck

    >dns

    >cpu bottleneck

  • Everything is working fine on my RPi, websites seems to load faster now also using a local DNS Server instead of using an external one hosted at a VPS :)

  • netomxnetomx Moderator, Veteran

    Now, try to use squid proxy to cache :)

    I wanted to try that

  • netomx said: Now, try to use squid proxy to cache :)

    Tried that, but turned out slower, as SD cards don't have the best read/write speeds.

  • netomxnetomx Moderator, Veteran

    @deejay31 I want to try that in a community that has 1mbps but if you connect to the US, the bandwidth will be 0.2mbps. Do you have any config for that?

  • netomx said: Do you have any config for that?

    Not personally, though you could try something like this

Sign In or Register to comment.