34

Say I have a public server with a service (email, web server, etc) that's accessible through https://myservice.example.com, and I would like to restrict that service with a VPN. How do I do that?

I know how to setup a VPN. I know how to use some of the services through that VPN. But see, if I want to use that VPN, I connect my client to that VPN, then I get the subnet of that VPN, say 10.10.100.0, through which I can access the devices by address.

But I see some services offer things like https://myservice.example.com, and they only work when that VPN is connected. How does that work? Is it just some DNS setting at the domain level or there's more to it?

you are viewing a single comment's thread
view the rest of the comments
[-] sloppy_diffuser@sh.itjust.works 2 points 1 year ago

Set myservice.example.com to an internal address like 10.10.100.x. Those addresses are not routable on the public internet. They can only be reached from a local network which the VPN tunnels you into.

If your VPN also supplies DNS to clients, can also add a private zone if its supported so nobody can resolve that internal address except those clients.

this post was submitted on 13 Aug 2023
34 points (94.7% liked)

Selfhosted

39276 readers
200 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