captive-browser icon indicating copy to clipboard operation
captive-browser copied to clipboard

dhcp-dns query using nmcli (for NetworkManager-managed DNS)

Open shazow opened this issue 5 years ago • 1 comments

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)

shazow avatar Feb 12 '19 15:02 shazow

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"

Mynacol avatar Apr 04 '23 23:04 Mynacol