captive-browser
captive-browser copied to clipboard
dhcp-dns query using nmcli (for NetworkManager-managed DNS)
My setup doesn't use dhcpcd nor systemd-resolved, but rather NetworkManager.
While I haven't had a change to test this with captive portals yet, I suspect this command should work:
dhcp-dns = "nmcli -t -f IP4.DNS device show | cut -d ':' -f2 | head -n1"
Not certain if it's necessary limiting to the first line.
Sharing in case it's useful for anyone else. Maybe worth adding to the README? (Happy to PR)
Slight improvement, removing cut
. Getting only the first element is not necessary if I understand the readme right, so I omitted that as well.
dhcp-dns = "nmcli --terse --get-values IP4.DNS device show"