I want to try hosting a website, I’d rather do self-hosted because I feel like I’d learn more doing it that way than if I went with a web hosting service, but have a question on DNS.
In theory anyone could check the IP address of the domain I choose to determine my geographic location. Is there a way to get around this? Perhaps like a VPN or proxy service?
Asking mainly because I have a static IP that never changes and would rather not reveal it. Also living in a country that has very harsh punishments for website owners that host any content it doesn’t like. The odds of me running afoul of these laws are slim but they are so broad and vague I’d rather take extra steps to mitigate the risk.
My understanding is cloudflare tunnels are a decent quick solution to this, but of course some don’t want to use them.
Keep in mind if your country’s laws are a concern, your ISP already knows the websites you visit and might even scan for open ports and notice you are hosting a website. You may not be able to truly protect yourself unless you somehow encrypt all outgoing traffic from your computer and rely on a proxy. Of course, I have no idea what the threat model is for your country or how aggressively they do those types of scans if at all.
Put something like Bunny CDN - bunny.net Documentation infront of your box, hides your origin (home server) IP to external requests. You only allow in connections from the CDN IP ranges, reject everything else.
I had wondered about the same thing, but the location given when I use tools like whatismyip.com is where my ISP is based rather than where my server is, so I don’t believe this is an issue in my case. Maybe this varies depending on the ISP but it’s something to check in case you haven’t.
Using a CDN is indeed the way to go: they provide you with a public IP so that yours is not set in any public record. GCore CDN has a generous free tier, Bunny CDN is 1€/month minimum. Know that these companies would most probably cooperate with a government request and reveal your identity / IP. I don’t recommend Cloudflare as they are killing the open web.
If you have (or want to learn) the technical skills, you can also rent a very cheap VPS (check out vpspricetracker for example, 256MB of RAM is definitely enough).
If you absolutely don’t want any public record of your self-hosted server (we’ll call it the origin server) setup the CDN to access it directly via the IP and not a subdomain. The typical setup documentation will have you setup a subdomain with https for the origin (so that the traffic between the proxy and your server is encrypted), but letsencrypt publishes a public record of every certificate they issue
The thing I want to hide here is not my location, but my IP address. I don’t want bots, scripts or other nefarious people hammering at my public IP address of my home connection.