Self hosting with your own domain, how to point a subdomain to a home server or NAS with SSL

For self hosting with your own domain you create an A record for a subdomain in the DNS zone, e.g. nas.example.gr, pointing to the public IP of your connection, and on the router you set up port forwarding to the server at home or in the office. You get the SSL certificate free with Let's Encrypt on the server itself. If your internet provider does not give you a public IP (CGNAT), you use a tunnel or VPN instead of port forwarding.

The steps below apply to a home server, NAS, Home Assistant, Nextcloud or any application you run yourself, with the domain and DNS zone at Konet.

Why I don't put the internal IP (192.168.x.x) in DNS

The addresses 192.168.x.x, 10.x.x.x and 172.16.x.x to 172.31.x.x are private. Every home and every office has the same ones. If you put one in an A record, anyone opening nas.example.gr from another network will look for that address on their own network and will not find your server. In addition, many routers reject such answers for security (DNS rebinding protection), and the record shows everyone how your internal network is set up. From outside, only the public IP reaches you.

If you want the same name to point to the internal IP while you are inside the network, see split DNS below.

Which solution fits me

Connection What you do
Static public IP A record to the IP and port forwarding
Dynamic public IP Dynamic DNS that updates the A record, and port forwarding
CGNAT, no public IP Tunnel or VPN, or ask your provider for a public IP
You don't want open ports Tunnel or VPN, and SSL with DNS-01

Step 1, find out if you have a public IP or CGNAT

  1. Open the router's admin page and find the WAN (or Internet) address.
  2. From a computer on the network open a page that shows "what is my IP".
  3. If the two addresses are the same, you have a public IP.
  4. If the WAN address starts with 100.64 to 100.127, or is private, you are behind CGNAT. Port forwarding will not work, because there is a second NAT of the provider between you and the internet.

Ask your internet provider whether your IP is static or dynamic. Many offer a static IP or a way out of CGNAT on request, often on business plans. Check their terms as well, because some do not allow servers on home connections or block ports.

Step 2, create the subdomain with an A record

  1. Open cPanel > Domains > Zone Editor and click Manage next to the domain.
  2. Click Add Record and select A.
  3. In Name enter the subdomain, e.g. nas.example.gr.
  4. In Record enter your public IP and click Save Record.

You do not need to create the subdomain from cPanel > Domains. That creates a subdomain with a folder on the hosting, while you only want a record pointing to another server. Details on records are in cPanel Zone Editor.

If your IP changes, do not update it by hand. cPanel Dynamic DNS gives you a link that the router or a script calls, and the A record updates itself.

Step 3, port forwarding on the router

On the router add a port forwarding rule (it may be called NAT, Virtual Server or Port Mapping) that sends external port 443 to the private IP and port of the server. If you will get SSL with the HTTP-01 method, add port 80 too. Give the server a fixed internal IP (DHCP reservation), otherwise the rule breaks when it changes.

Open only the web ports. Do not expose the NAS admin, the router admin, SSH or Remote Desktop to the internet. Use a VPN for those.

Step 4, SSL with Let's Encrypt

Konet's free AutoSSL covers what is hosted on your hosting account. For a server at home, the server itself issues the certificate with an ACME program. There are two validation methods.

HTTP-01 through a reverse proxy

The simplest solution is a reverse proxy, such as Nginx Proxy Manager, Caddy or Traefik. It receives all traffic on 443, issues and renews certificates by itself and sends traffic to the right application per subdomain, e.g. ha.example.gr to Home Assistant and cloud.example.gr to Nextcloud. HTTP-01 needs port 80 open to the proxy and does not issue wildcards.

DNS-01, with no open ports

With DNS-01 (the Let's Encrypt DNS challenge) you prove you control the domain with a temporary TXT record _acme-challenge in the zone. It works even for a server not visible from the internet, and it is the only way to get a wildcard certificate (*.example.gr).

  • For automatic renewal, the ACME program must write to the zone. Tools such as acme.sh and lego connect to cPanel with a username and an API token.
  • A cPanel API token gives access to the whole hosting account, not only to DNS. Keep it only on a server you protect, with an expiry date, and revoke it if you don't need it.
  • A more careful option is to delegate only _acme-challenge with a CNAME to a separate zone, so the server at home has no access to the hosting.

The lifetime of Let's Encrypt certificates is getting shorter in stages (64 days from February 2027, 45 days from February 2028), so renewal must be automatic. If you want a commercial certificate, a wildcard covers all subdomains, as we explain in SSL for an eshop, DV, OV, EV and Wildcard. On your own server you install it yourself.

The subdomain doesn't open inside the network, what is split DNS

Many routers do not handle a connection from inside to their own public IP correctly (NAT loopback or hairpin NAT). Then nas.example.gr opens from a phone on 4G but not from the home Wi-Fi.

The solution is split DNS: in the network's local DNS (the router, a Pi-hole or AdGuard Home) you set nas.example.gr to answer with the private IP. Inside the network you go straight to the server, outside you go through the public IP, and the certificate is valid in both cases because the name is the same.

Behind CGNAT, tunnel or VPN

  • Tunnel: a program on the server opens an outgoing connection to a tunnel service, such as Cloudflare Tunnel, and the service receives the traffic for the subdomain. You open no ports. Usually the subdomain becomes a CNAME to the service, and some require you to move the nameservers to them.
  • VPN: with WireGuard or Tailscale you connect to your network only from your own devices. It is the safest choice for a NAS and Home Assistant that the world does not need to see.
  • Public entry point: a small server with a public IP receives the traffic and sends it home over WireGuard. If you want something like this, a VPS is unmanaged and you set it up yourself, as we explain in managed or unmanaged VPS.

Frequently Asked Questions

Can I have SSL for a subdomain that points to an internal IP?
Yes, with Let's Encrypt and DNS-01, which needs no access from the internet. The name must exist in the public zone, and inside the network you solve it with split DNS.

Will my website or email be affected?
No. You only change your own A record for the subdomain. The records of the domain, www and email stay as they are.

How fast will the new subdomain work?
DNS changes usually show within a few hours. On some networks up to 48 hours. With cPanel Track DNS you see what the record returns.

I have CGNAT, can I do port forwarding?
No, the router rule does not reach the internet. Ask your provider for a public IP or use a tunnel or VPN.

Can I host the company website on the home server?
It is possible, but availability depends on the connection, the power and the updates you do yourself. For a website that must always be available, hosting is the safer choice.

Was this article helpful?

Related service Konet Web Hosting cPanel, LiteSpeed and automatic backups: 24 every 2 hours for 48 hours, then 6 daily, 4 weekly and 3 monthly.