22
DNS issues (feddit.it)
submitted 5 months ago* (last edited 3 months ago) by Shimitar@feddit.it to c/selfhosted@lemmy.world

Hi! i am selfhosting my services and using a DNSMasq setup to provide ad-blocking to my home network.

I was thinkering with Unbound to add a fully independent DNS resolver and not depend on Google/Adblock/Whatever upstream DNS server but i am unable to make Unbound work.

Top Level Domains (like com, org...) are resolved fine, but anything at second level doesn't. I am using "dig" (of course i am on linux) and Unbound logging to find out what's going on, but i am at a loss.

Could be my ISP blocking my requests? If i switch back to google DNS (for example) all works fine, but using my Unbound will only resolve TLDs and some random names. For example, it will resolve google.com but not kde.org...

Edit: somehow fixed by nuking config file and starting over.

you are viewing a single comment's thread
view the rest of the comments
[-] Shimitar@feddit.it 1 points 5 months ago

I want to go directly to the source, i mean, if i want to resolve, for example www.polito.it, i want to ask "it", then "polito.it"... This is what Unbound should be doing.

Instead, i can resolve it:

server /etc # dig it @127.0.0.1

; <<>> DiG 9.16.48 <<>> it @127.0.0.1
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 59860
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1232
;; QUESTION SECTION:
;it.                            IN      A

;; AUTHORITY SECTION:
it.                     3194    IN      SOA     dns.nic.it. hostmaster.nic.it. 2024062114 10800 900 604800 3600

;; Query time: 0 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Fri Jun 21 14:50:06 CEST 2024
;; MSG SIZE  rcvd: 86

Instead i cannot resolve polito.it:

server /etc # dig polito.it @127.0.0.1

; <<>> DiG 9.16.48 <<>> polito.it @127.0.0.1
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 60832
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1232
;; QUESTION SECTION:
;polito.it.                     IN      A

;; Query time: 1180 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Fri Jun 21 14:50:40 CEST 2024
;; MSG SIZE  rcvd: 38

Nothing appears in the logs. It resolve fine using 8.8.8.8 as upstream DNS.

[-] lemmyvore@feddit.nl 2 points 5 months ago* (last edited 5 months ago)

polito.it may not be the best example because its A records point at private IPs (192.168.x.x). Such records are often filtered by ISP DNS servers because they are used in certain kinds of attacks.

Double check your results using DNSChecker.

Edit: also, using just dig will not resolve all possible records related to a domain. I use a script that asks dig explicitly for a variety of record types:

#!/bin/bash
echo "SOA NS A AAAA MX CNAME TXT SRV DNSKEY"|\
xargs -n1 dig +noall +answer +nocrypto "$@"|\
sort -u -k4
this post was submitted on 21 Jun 2024
22 points (89.3% liked)

Selfhosted

40406 readers
582 users here now

A place to share alternatives to popular online services that can be self-hosted without giving up privacy or locking you into a service you don't control.

Rules:

  1. Be civil: we're here to support and learn from one another. Insults won't be tolerated. Flame wars are frowned upon.

  2. No spam posting.

  3. Posts have to be centered around self-hosting. There are other communities for discussing hardware or home computing. If it's not obvious why your post topic revolves around selfhosting, please include details to make it clear.

  4. Don't duplicate the full text of your blog or github here. Just post the link for folks to click.

  5. Submission headline should match the article title (don’t cherry-pick information from the title to fit your agenda).

  6. No trolling.

Resources:

Any issues on the community? Report it using the report flag.

Questions? DM the mods!

founded 2 years ago
MODERATORS