@mozartatplay said in DNS not being issued to clients until after captive portal login:
Any tips to overcome this?
These are the settings of the DHCP server of my 'PORTAL' network, 192.168.2.0/24 :
[image: 1656261716325-53d69f84-4a30-4d06-b561-d740268fe201-image.png]
I did set 192.168.2.1 as the DNS server. I'm not sure if that is actually needed, if pfSense is the networks DNS also.
Unbound (pfSense) is listening on that interface.
Debugging the DHCP session on te user side : it gets an DNS server.
ipfw firewall rules do permit DNS traffic, even when the device isn't logged into the portal yet.
@mozartatplay said in DNS not being issued to clients until after captive portal login:
the client (My Mac) does not use this DNS record until the user either authenticates with the captive portal or chooses to close the captive portal screen.
If your device doesn't want to use a DNS given by an upstream router/DHCP server, your connection will be mostly useless.
Never saw such a thing while using iPad's or iPhones.
These devices will NEED a DNS as the throw out automatically a http://www.apple.com/captivepoprtal.html test page to check if the device is behind a captive portal.
For "www.apple.com" to resolve, a DNS must work.
@mozartatplay said in DNS not being issued to clients until after captive portal login:
This is a big problem if you want to run local offline services (before authenticating to use the internet) that require a hostname (not an IP address - and need a DNS) - I have links to these local services on the captive portal page
Keep in mind that most of the captive portal support is build in the devices using the captive portal. Not pfSense !! pfSEnse just uses some clever firewall rules - and it redirects http (port 80) http requests) for device that are not authenticated yet.
These devices throw out a http ( not https ! - no one can't redirect https ) request.
Every device, actually, the OS, can chose whatever http domain is used. A working link to the Internet is not an really option when you want to use the (pfSense) captive portal.
But, if I cut my WAN connection, the captive portal login page still pops up : the request to http://www.apple.com/captivepoprtal.html test page (I used my iPhone) failed after a DNS timeout (might be rather long).