DNS issues: subdomains resolve outside my network but not inside

I just rebuilt my pFsense box and now my domains are no longer resolving within mynetwork.

I have two domains i.e. mydomain1.com and mydomain2.com. My domain2.com is used for a number of other sites e.g. site1.mydomain2.com, site2.mydomain2.com etc.

Nginx Proxy Manager (the GUI version) manages these. From outside my network I can reach both domains and associated websites.

From within my network, none of the subdomain s for mydomain2.com or mydomain1 is reachable from within my network. When I try, I get “ERR_EMPTY_RESPONSE”

Both domains are hosted with on Cloudflare, and point to my external IP using a cname mygateway.domain3.com.

The cloudflare DNS is setup the same way for all domains. The system was working before my old pFsense box fell over so the only thing that has changed is pFsense (not nginx as that is running its original docker container).

NSLOOKUP returns the below

nslookup mydomain1.com
Server:  pfSense.mydomain3.com
Address:  192.168.17.12

Non-authoritative answer:
Name:    mydomain1.com
Address:  my.external.i.p

and for the other domain

nslookup site1.mydomain2.com
Server:  pfSense.mydomain3.com
Address:  192.168.17.12

Non-authoritative answer:
Name:    mygateway.mydomain3.com
Address:  my.external.i.p
Aliases:  site1.mydomain2.com

mygateway.domain3.com = my.external.i.p

There are no manual DNS entries for domain1 or domain2 in my pFsense server.

tracert returns the correct final IP.

I’m not sure I understand. If you are hosting the services on your LAN then you need to have DNS entries to point to your NPM LAN IP. Otherwise you will run into a DNS rebind attack issue.

But if that is what you desire and don’t want internal dns records then disable rebind attack protection on pfsense.

Ok, that makes sense… not sure how it did it last time… but will stick with the internal records.