this post was submitted on 18 Jan 2024
14 points (81.8% liked)

Selfhosted

40183 readers
732 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 1 year ago
MODERATORS
 

I am looking to setup a public DNS server and I found this DNS server

https://technitium.com/dns/

Does anyone know what the risks are of exposing the DNS port to the internet? How likely am I to get compromised? Is this a really bad idea?

top 30 comments
sorted by: hot top controversial new old
[–] AtariDump@lemmy.world 18 points 10 months ago* (last edited 10 months ago) (3 children)

Do. Not. Open. Port. 53. To. The. Internet.

Just Don't.

This is a really bad idea.

If you’re trying to reach something on your network, VPN back in.

[–] nik282000@lemmy.ca 3 points 10 months ago (1 children)

I ran my ssh behind 53 for a while because it's rarely blocked. A few bots even got it right and figured out it was ssh.

[–] EncryptKeeper@lemmy.world 4 points 10 months ago

This is why the concept of running services until different ports than default isn’t a real security measure, it doesn’t actually take any effort to figure out what kind of service is running on a port.

[–] possiblylinux127@lemmy.zip 1 points 10 months ago (4 children)

How do I resolve my domain name?

[–] billwashere@lemmy.world 1 points 9 months ago

Check out Tailscale.

[–] ikidd@lemmy.world 1 points 10 months ago* (last edited 10 months ago)

From outside? Set up a Cloudflare account and point the NS from your registrar to it.

From inside? Set up unbound on a docker host and don't open it to the internet. Use that one when you're local and the normal public DNS when you're outside. But everything I'm seeing in here makes me sure you shouldn't even consider opening ports in your firewall to expose inside host services. Use a VPN when you're roaming, and only use your DNS for local servers/hosts via that VPN. The only use for your outside domain name should be to point a single hostname to your outside IP address so you can use it for your VPN endpoint.

Use DNS challenges for LetsEncrypt cert requests and remove host entries from your Cloudflare after you get your cert.

[–] Rootiest@lemmy.world 1 points 10 months ago* (last edited 10 months ago)

I use a DNS server on my local network, and then I also use Tailscale.

I have my private DNS server configured in tailscale so whether on or off my local network everything uses my DNS server.

This way I don't have to change any DNS settings no matter where I am and all my domains work properly.

And my phone always has DNS adblocking even on cell data or public Wi-Fi

The other advantage is you can configure the reverse proxy of some services to only accept connections originating from your tailscale network to effectively make them only privately accessible or behave differently when accessed from specific devices

[–] AtariDump@lemmy.world 1 points 10 months ago
[–] Gooey0210@sh.itjust.works -2 points 10 months ago (1 children)

Or use encrypted dns 😕 it's 2024, time to use encryption

[–] AtariDump@lemmy.world 2 points 10 months ago (1 children)

That wouldn’t help with an open resolver.

[–] Gooey0210@sh.itjust.works -2 points 10 months ago* (last edited 10 months ago) (1 children)

Use encryption, using vpns for such a trivial task is a "really bad idea"

There are many cases when somebody wants to have their dns public, maybe they want to share with their friends, family, community, audience (not everyone is a solo server user)

Also, it's good to use your dns even before connecting to the vpn. Just use encryption, it's safe and nice

Keeping 53 opened is not that bad, the only thing you will notice is an increased load on your server if somebody tried to ddos somebody's server using your dns

P.S. Or as somebody mentioned below, use rate limiting. It's described pretty well in some other comments. Not just "spooky internet port"

[–] atzanteol@sh.itjust.works 1 points 10 months ago* (last edited 10 months ago) (1 children)

Use a public dns provider. Cloudflare, route53, dyndns (are they still around?), etc. Cheap, reliable, no worries about joining a ddos by accident. Some services are better left to experts until you really know what you're doing.

And if you do really know what you're doing you'll use a dns provider rather than host your own.

[–] Gooey0210@sh.itjust.works 2 points 10 months ago (1 children)

Cloudflare is not private.. not sure if dyndns has even worse reputation than cloudflare

Some services are better left to experts until you really know what you're doing.

DNS, for experts? 😂

You host your own dns, and don't work with glowing services, this is the private way

[–] atzanteol@sh.itjust.works 2 points 10 months ago (1 children)

Host your own private DNS - yes, knock yourself out. I highly recommend it.

Public DNS? No - don't do that.

There are two services homegamers should be extra cautious of and should likely leave alone - DNS and email. These protocols are rife with historic issues that affect everybody, not just the hosting system. A poorly configured DNS server can participate in a DDOS attack without being "hacked" specifically. A poorly configured mail server can be responsible for sending millions of spam emails.

For a homegamer you probably only need a single public DNS record anyway (with multiple CNAME if you want to do host based routing on a load balancer). You take on a lot of risk with almost zero benefit.

[–] Gooey0210@sh.itjust.works 1 points 10 months ago (1 children)

You don't knock yourself out, it doesn't look like you ever even tried it

See you when you start selfhosting stuff, or at least get interested

Also, knocking yourself out is not privacy, but anonymity 🤭

[–] atzanteol@sh.itjust.works -1 points 10 months ago

Uh oh - my "nerd creds" are being questioned by a rando on the internet. 🤣

[–] ShitpostCentral@lemmy.world 16 points 10 months ago (1 children)
[–] Shdwdrgn@mander.xyz 13 points 10 months ago

This right here. As a member of the OpenNIC project, I used to run an open resolver and this required a lot of hands-on maintenance. Basically what happens is someone sends a very small packet requesting the lookup of something which returns a huge amount of data (like DNSSEC records). They can make thousands of these requests in a short period, attempting to flood out the target domain's DNS servers and effectively take them offline, by using your open server as the attacker.

At the very least, you need to have strict rate-limiting controls on DNS lookups. And since the requests come in through UDP, they can spoof their IP address so you can't simply block an attacker. When I ran into this issue, I wrote up scripts to monitor for a lot of requests to the same domain name and outright block those until the attack stopped. It wasn't a great solution, but it did at least make sure my system wasn't contributing to an attack.

Your best bet is to only respond to DNS requests for your own domain(s). If you really want an open resolver, think about limiting it by creating some sort of sign-up method (for instance, ddns servers use a specific URL to register the changing IP of known users), but still keep the rate-limiting in place.

[–] Moonrise2473@feddit.it 4 points 10 months ago (1 children)

I use technitium but it's like pihole, designed for a few concurrent users in a local network? Instead you want that anyone in the world can use your DNS?

But you would only attract bad actors, normal users won't use a random DNS server as it could redirect specific sites to phishing pages

[–] possiblylinux127@lemmy.zip 2 points 10 months ago (1 children)

I'm going to use it to resolve my domain.

[–] Moonrise2473@feddit.it 2 points 10 months ago (1 children)

Ah you want to host a name server

That's the hardest thing ever to self host, can't just use the free name server service from the registrar or cloudflare?

IMHO even the most dedicated sysadmin wouldn't even think to self host that

[–] possiblylinux127@lemmy.zip 1 points 10 months ago

I'm starting to realize it would be a massive headache.

[–] ninjan@lemmy.mildgrim.com 1 points 10 months ago (1 children)

DNS is plenty secure due to its simplicity and age. From the perspective of securing your server that is. DNS has numerous flaws when it comes to security in terms of can you trust the resolved name. But that is another matter.

I'd be more worried about the gui, keep that behind a secure proxy or don't expose it to the internet at all if we're talking a server at home.

I run my own DNS and it's virtually a prerequisite if you want to host stuff under a personal domain in a smooth fashion. At least if you don't want to rely on a big player like say Cloudflare.

[–] atzanteol@sh.itjust.works 1 points 10 months ago (1 children)

I've had my own domain since the early 2000s and have never needed to run a public dns server. Couldn't, in fact, due to not having a static ip address. Sure, I run one internally but it's complicated enough to setup "properly" that I leave the external resolution to the big players. I doubt anyone's home setup will be more reliable than route53...

Commercial dns services are cheap as chips and make it easy to add records. You can often automate it with terraform or sensible as well. I can't think of any good reason not to use one.

[–] ninjan@lemmy.mildgrim.com 1 points 10 months ago (1 children)

And I explicitly said "unless you want to rely on a big player".

Personally I'm very fed up with AWS, Cloudflare and Google virtually owning the modern Internet. I selfhost to get away from their spying and oligopoly so routing DNS through them is simply out of the question, for me.

And really it's not that hard these days with pre-packaged Docker containers. I have a fairly complex setup and while I have put hours into it it wasn't rocket surgery by any means. It's also quite healthy to understand how DNS actually works if you work with the Web imo.

[–] atzanteol@sh.itjust.works 1 points 10 months ago (1 children)

Personally I’m very fed up with AWS, Cloudflare and Google virtually owning the modern Internet. I selfhost to get away from their spying and oligopoly so routing DNS through them is simply out of the question, for me.

I get that - but part of the reason for the current situation is that DNS is such a bad protocol that is risky to leave in unskilled hands. You can do damage beyond just your host. DNS is a big target and servers can find themselves participating in DDOS attacks. The big players do traffic analysis and rate limiting to minimize these things.

And really it’s not that hard these days with pre-packaged Docker containers.

It's not that it's "hard to run a name server" it's that it's tricky to configure one correctly so as to be a "good neighbor" on the internet. Most homegamers only need a single "A" record anyway - maybe some CNAMEs. It's not like you need anything complicated. And if you don't have a static IP address then you definitely want your DNS server to be updatable easily with a new IP. Updating NS records is more complicated.

Running an internal name server is fine and a great experience. You can do so much more on your own network than you would likely do with a public name server anyway.

[–] ninjan@lemmy.mildgrim.com 1 points 10 months ago (1 children)

Only doing resolution for your own domain and dnssec solve pretty much all those issues and is pretty darn easy.

And I did say that the web gui is what you need to lock down, DNS has no vulnerabilities exploitable through port 53 that lets an attacker take control of the server.

[–] atzanteol@sh.itjust.works 1 points 10 months ago (1 children)

You're saying "If you configure your DNS server properly and understand how it works then it can be setup securely."

I'm saying "Have you seen the questions in this community???"

[–] ninjan@lemmy.mildgrim.com 2 points 10 months ago

... Touché

[–] Decronym@lemmy.decronym.xyz 1 points 10 months ago* (last edited 9 months ago)

Acronyms, initialisms, abbreviations, contractions, and other phrases which expand to something larger, that I've seen in this thread:

Fewer Letters More Letters
DNS Domain Name Service/System
IP Internet Protocol
UDP User Datagram Protocol, for real-time communications
VPN Virtual Private Network

[Thread #438 for this sub, first seen 19th Jan 2024, 00:35] [FAQ] [Full list] [Contact] [Source code]