Using nscd to reduce DNS lookups with stats scripts (v28 image)

Discussion in 'Other technical not related to ADSBx Feeding' started by John MI0SYN, Dec 24, 2019.

Tags:
  1. John MI0SYN

    John MI0SYN New Member

    Hi all,

    I run pihole on my LAN and see DNS lookups to adsbexchange dot com every 6 seconds. It appears the curl command called from the json-status script isn't honouring DNS TTLs properly.

    Installed nscd on the feeder and it's stopped those lookups.

    Might be worth checking your own machines if you've added the stats package.
     
  2. James

    James Guest

    It's more a linux sub-system that it doesn't cache DNS.

    I'll look to add it to 1.29
     
  3. John MI0SYN

    John MI0SYN New Member

    That'd be great, thanks James!
     
  4. wiedehopf

    wiedehopf Administrator Staff Member

    Who cares about a DNS request every 6 seconds?

    That's not an issue at all.
     
  5. John MI0SYN

    John MI0SYN New Member

    It is for pihole users ;-)
    We pay close attention to our stats including blocked sites and busy clients and my ADSBx Pi was the top DNS client before adding nscd.

    I'm looking to add other ADSBx boxes at other sites so want them to behave (they'll be guests on other peoples' networks).
     
  6. wiedehopf

    wiedehopf Administrator Staff Member

    99% of home routers do DNS caching anyway.
    Compared to the beast data stream and the data used by the mlat client, the DNS requests will use much much much less resources.

    beast data plus mlat-client will add up to a bandwidth of 5 KB/s to 35 KB/s depending on how many messages you receive.
     
  7. James

    James Guest

    I really wish Pihole wouldn't make people experts on DNS.

    https://netbeez.net/blog/how-dns-cache-works/

    Some moron on reddit has a Pihole and thinks he's the haxxor preventing Internet Wizard.

    https://www.reddit.com/r/ADSB/comments/cxz2cd/i_dont_trust_adsb_exchange_i_dont_think_you/


    "It appears the curl command called from the json-status script isn't honouring DNS TTLs properly."

    You're wong. It has nothing to do with curl.


    Linux doesn't cache DNS at OS level, so I not sure I'll add another complexity layer to the image. Individuals can do this themselves and if it break their shit - not my problem to support all the Pi holes of the worlds. And there are a lot of Pi hole DNS Wizards ...

    I suppose you could just add our static public IP as entries in hosts

    http://manpages.ubuntu.com/manpages/trusty/man5/hosts.5.html

    Code:
    167.114.60.74  feed.adsbexchange.com
    167.114.60.76  adsbexchange.com
    167.114.60.77  adsbexchange.com
    
    
    Or install and configure yourself.


    Code:
    sudo apt update
    sudo apt install nscd
    
     
    Last edited by a moderator: Dec 27, 2019
  8. John MI0SYN

    John MI0SYN New Member

    Thanks James. I'd previously installed nscd which slowed the requests - they now seem to query DNS only on TTL expiry.
    So yes, that should work for others too.
     
  9. James

    James Guest

    Excellent.