Illustrated title card for the guide: Split-Horizon Local DNS With a Home Reverse Proxy
networking

Split-Horizon Local DNS With a Home Reverse Proxy

Use pfSense and Caddy to keep one HTTPS hostname at home and away. Set the LAN DNS override and use dig and curl to check both paths.

Point your local DNS override at your reverse proxy’s LAN IP and keep the public DNS record pointed at your WAN IP. With split-horizon DNS, clients on Caddy’s LAN that use the override reach Caddy directly via the HTTPS hostname. Outside clients using public DNS reach Caddy at the same hostname through your existing port forward. Netgate split DNS recipe · Caddy reverse proxy guide

Plan the LAN and public answers

This IPv4-only example assumes a running Caddy instance, an active pfSense DNS Resolver, and an existing public A record and WAN port forward to Caddy. Substitute your own hostname and addresses for these example values. Netgate split DNS recipe · Caddy HTTPS requirements

ItemExample value
HTTPS URL on either networkhttps://app.example.com
LAN A answer for app.example.com192.168.1.5, the Caddy host
Public A answer for app.example.comYour existing WAN IPv4 address
pfSense LAN DNS resolver192.168.1.1
HTTP backend on the Caddy host127.0.0.1:9000

With the client and Caddy on the same LAN, the connection avoids the WAN port forward and needs no NAT reflection. Use the same HTTPS port on both paths. This example uses 443. Netgate split DNS and port requirements · Caddy Automatic HTTPS

Use the public hostname in Caddy

Configure Caddy to serve app.example.com and send requests to the local HTTP app. Add this site block to your active Caddyfile, or edit the existing block for that name. Caddy reverse proxy guide · Caddy upstream address syntax

app.example.com {
    reverse_proxy 127.0.0.1:9000
}

If the running instance’s admin endpoint is enabled at its default address, reload from the directory containing the active Caddyfile. If Caddy cannot provision the new configuration, it keeps the active one running. Caddy command-line reference

caddy reload --config Caddyfile

Caddy’s standard public HTTPS setup assumes public DNS points at the server’s public entry point, ports 80 and 443 are reachable from outside and routed to Caddy, and Caddy’s data directory is writable and persistent. With those prerequisites met, Caddy’s automatic HTTPS serves qualifying hostnames over HTTPS and renews their managed certificates. Caddy Automatic HTTPS

Add the pfSense DNS override

In pfSense, go to Services > DNS Resolver and open Host Override Options under Host Overrides. Enter the following values, click Save, then click Apply Changes. Netgate split DNS setup · Netgate host override fields

FieldValue
Hostapp
Domainexample.com
IP Address192.168.1.5

If pfSense also provides LAN DHCPv4, open Services > DHCP Server, select the LAN interface, and check DNS Servers. With those fields blank, pfSense supplies itself when it is handling DNS through its built-in resolver. If you use custom DHCP DNS settings, enter the pfSense LAN address in DNS Servers. For a client with manual DNS settings, use that same address. Netgate DHCPv4 server options · Netgate split DNS recipe

Verify DNS and HTTPS from both networks

On the LAN, query pfSense directly, then run a lookup without specifying a server. The first should return 192.168.1.5, and so should the second if the client uses pfSense for DNS. From a device outside your home network that uses public DNS, run the second command again and expect your WAN IPv4 address. ISC dig manual · Netgate split DNS recipe

dig @192.168.1.1 app.example.com A +short
dig app.example.com A +short

Run the HTTPS request from both networks. Use curl’s verbose output to troubleshoot the request, and check that the response is from your app. curl command-line manual · Netgate split DNS recipe

curl -v https://app.example.com

If HTTPS fails on the LAN, make a direct request to Caddy’s LAN address. The --noproxy app.example.com option bypasses any configured proxy for this hostname. The --resolve option supplies the address for that hostname and port. Curl verifies the certificate against app.example.com by default. curl command-line manual

curl -v --noproxy app.example.com --resolve app.example.com:443:192.168.1.5 https://app.example.com

If the forced request serves your app and the ordinary LAN dig lookup returns the wrong address, start with the client’s DNS settings. If curl reports a certificate error, check that the certificate matches the hostname and that the signing CA is trusted by curl. If TLS succeeds but the app fails to load, check the backend from the Caddy host. curl command-line manual · Caddy reverse proxy guide

curl -v http://127.0.0.1:9000

Evidence and limits. The examples follow the pfSense latest documentation, Caddy 2 documentation, BIND 9.20.18 manual, and curl manual, checked November 26, 2026. The commands were not run for this article.

Sources

  1. Netgate: Accessing Port Forwards from Local Networks
  2. Netgate: NAT Reflection and Split DNS
  3. Netgate: DNS Resolver Host Overrides
  4. Netgate: DHCPv4 Server
  5. Caddy: Reverse Proxy Quick-Start
  6. Caddy: reverse_proxy Directive
  7. Caddy: Command Line
  8. Caddy: Automatic HTTPS
  9. ISC: BIND 9 dig Manual
  10. curl: Command-Line Manual

Related