Getting my own domain
I had several services under my belt at this point…
Jellyfin for my media, Samba to have a local network share, Minecraft for my friends, and even this blog! Two of those- Minecraft and this blog- are open to the internet. My blog made use of the default GitHub Pages URL, which was fine if a little unpleasant to type. But in order for my friends to join the Minecraft server, the had to use my IP address directly. The answer to this is one I’ve been wanting to do for a while, but didn’t have a great reason to.
Introducing Porkbun! Porkbun is one of many sites where you can purchase a domain. The price on domains varies wildly based on your top-level domain (.com vs .top), but it’s always a yearly subscription. My domain, coderino.top, was a mere $5 for a full year of use! I spent a good amount of time searching through the low end of the domain(s) I wanted to purchase in various configurations. None of the top-level domains for coder were ones that I wanted on my website, but after a few tries I found this domain at a reasonable price.
After purchasing the domain, you have to link the domain to the host machine. For GitHub Pages, i.e this blog, it was very easy. Both GitHub and Porkbun have special tabs specifically for registering GitHub Pages with a domain. When you do so, it adds the numerous IPs that could point to your page. I also needed my domain to point to my server’s public IP, though, which did take a very minor amount of research.
Domain name records come in a variety of forms, but the ones I’ve most commonly used are A records (for IPv4), AAAA records (for IPv6) and CNAME records (for pointing to an A or AAAA record). Once I knew the difference between the different records I was looking at, I simply registered my server’s public IPv4 with Porkbun using an A record. It takes some time for a new domain to be added to the various DNS Servers - like Google DNS and Quad-9 - as well as collecting your Let’s Encrypt certificates. After a few days, though, your domain should be available widely for public use. It takes less time for Porkbun to collect certificates, only an hour or two, for those interested in using HTTPS for their online traffic. Which you should be: sending plaintext over the internet is almost never a good idea!
Now that I had a way to set specific domains for specific services, I wanted to clean up how I handled traffic to and from my server. Keeping various ports open through my firewall when I needed multiple HTTPS services running would increase my attack surface. So I spoke to some friends who had done this before, and they gave me some good ideas to try later…