Elijah Lieu

Homelab DNS Troubles

Over the past week, I’ve been setting up my homelab on a pretty beefy laptop whose screen unfortunately broke on me a few years ago.

I recently moved into an apartment that manages its network in a way that I can’t configure any router settings. As of right now, my homelab is built on DHCP and a dream - but that’s an improvement from what it was!

A wishlist

I want my homelab to be relatively functional with security and flexibility in mind. With that being said, here’s a non-exhaustive list of what I set out to set up:

These were pretty much my only goals at first.

Attempt 1

I got pretty far before I learned a few things that in hindsight felt pretty obvious:

To access my Proxmox instance, I created a Tailscale LXC and made it a subnet router so that I wouldn’t have to put Tailscale on the host or any other VM/LXC.

Then, it came time to install Vaultwarden. I was very excited, until I learned I needed to self-sign certificates. Fortunately, openssl is very well documented and online tutorials and AI make up for my lack of patience.

Certified shenanigans

Unfortunately, Android does not appreciate my self-signed certificate (rightfully so). The Bitwarden app really didn’t like it. I thought manually importing the certificate on my phone would work, but then the Bitwarden app still threw a tantrum. I decided I would kill two birds with one stone, and set up DNS and handle this certificate issue using Nginx Proxy Manager.

Now, I’ve never used (this) NPM, but I found a video outlining the exact process I wanted. Granted, he was using Docker, but it didn’t really make a difference. I’ll be summarizing what I did based off of the video, but I like my solution more.

In the later half of the video, the homelabber’s strategy was to create a public DNS A record to point his NPM subdomain to his private IP. He then created a wildcard CNAME record that pointed all other subdomains to his NPM subdomain.

If you’re like me and don’t know what A and CNAME records are, see it like this:

One aspect that he did not cover that I was concerned about was using a domain that is already in use. I’m cheap, and I’m using this domain (elieu.dev) for both this blog and my private homelab.

It turns out, I can kill two eggs with one bird, because his end solution ends up with sub-subdomains like foo.bar.baz.com, but mine is only foo.bar.com. My blog is unaffected if you’re reading this.

What I ended up doing was making two more records on Cloudflare:

My existing records handle my blog.

Here’s the key part: on NPM, I made an SSL certificate for just *.elieu.dev, not whatever the video did. This allowed me to create all of the single subdomains I wanted that get resolved by NPM!

Real homelab hours

With DNS and SSL fixed, my Vaultwarden now works from the Bitwarden app.

Some things I’ll be adding to my homelab soon (or have added):

See you when my DHCP lease ends!