Setting up internal DNS(+cache) on Synology NAS

First thing I did when I received my second hand NAS I bought a completely useless domain name to access it via the internet. Although we have a dynamic IP address I don’t bother setting up DDNS but just change the dns settings from my provider when my IP changes.

Why internal DNS?

That said, I wanted applications that work via the internet outside my home to work the same way in home. It had to, considering the WAF factor. Until now I had to use the internal IP on my network and the domain name from outside our network.

After some googling it ended up being rather simple, but there are a lot of versions out there and I thought I’d just add another one to complete the chaos we all love so much.

In time this setup will be replaced by a raspberry Pi running PiHole, but that will be in a later post.

How did I do it?

I installed the DNS server package. No need to open or forward ports since everything is inside your local network.

After installing I created a new master zone, with my domain name as domain name and host id. It automatically cointained the NS and second A record. I only created the first A record forwarding the domain name to my Synology.

The next step probably isn’t necessary, because most devices and routers can handle two or more dns servers, but I turned on the resolution service and chose the cloudflare dns service to use if my Synology doesn’t know the record a client is looking for.

Now I just had to change the dns settings in my router to look for the record on my Synology first and renew the lease on all devices so apps like DS file could also use the domain name to login when inside my home network.

A little bonus

The following adds a little bonus to the fact that you use your own dns server. The synology can cache your queries so next time you visit a website you visit before your Synology will know immediately where to send you and doesn’t have to look it up first.

The following settings work for me, but everyone uses their system differently so maybe you could do with a smaller cache or need a bigger one or you need the resources for something totally different.

There you go! You can now set up everything pointing to the same domain name and made your home network faster in the process. If you have any questions or remarks, din’t hesitate to leave them here and I will get in touch asap.

The Genesis blog

A.k.a. my first blog post on this website. Don’t expect a whitepaper or something. I just needed some space in my head and that’s best done by writing stuff and since writing on a piece of paper results in tons of head scratching wondering what the hell I wrote down. I decided it was best done in digital form and then, why not on the internet.

I love browsing other peoples how-to’s and always find my own situation just a tad bit different but often lack the balls to comment or just don’t want to sign up to yet another service to do so.

Since I don’t like (having) a lot (of different) internet services I try to do most things myself. Same goes for this website, it is hosted on my Synology NAS in the attic. I have just ordered my first Raspberry Pi and have some neat plans and love reading books. In English and in Dutch so some of my posts will be in Dutch as well.

I’m an autodidact and I’ll love to learn to code and write my own software so that’s what I’ll try to do the coming year(s). There’s not a lot of spare time in my schedule, but you’re welcome to join me in my journey or just tag along some trips.

Happy browsing and please don’t hesitate to ask any questions you might already have or to send me your remarks. I’ll try to make it as easy as possible.