Show DNS settings managed by NetworkManager
Build a paste-ready command, then review its compatibility and effects before running it.
nmcli -f GENERAL.DEVICE,IP4.DNS,IP4.DOMAIN device showread-onlyno known side effects Compatibility
LinuxVerified for Linux using posix, bash, zsh syntax.
Operational knowledgereview due 2027-01-20
Requirementsnmclinmcli must be installed and available on PATH.
Version supportnmcli Current supported releasesVerified for linux using posix, bash, zsh syntax; consult compatibility notes for platform-specific differences.
Expected signalsGENERAL.DEVICE: eth0Representative successful output; values vary with the selected target and system state.
Known errorsnmcli: command not foundnmcli is missing or is not available on PATH.
Verifynmcli -f GENERAL.DEVICE,IP4.DNS,IP4.DOMAIN device showThe output matches the expected target and exits without an error.Rollback noteNot required: this command is read-only and does not change system state.
Command breakdown
01nmcliCommandRuns the nmcli stage of this one-liner.
02-fOptionKeeps following new output or selects the command-specific force/file mode.
03GENERAL.DEVICE,IP4.DNS,IP4.DOMAINArgumentPasses GENERAL.DEVICE,IP4.DNS,IP4.DOMAIN to nmcli.
04deviceArgumentPasses device to nmcli.
05showArgumentPasses show to nmcli.
Example input
nmcli -f GENERAL.DEVICE,IP4.DNS,IP4.DOMAIN device show
Example output
GENERAL.DEVICE: eth0
IP4.DNS[1]: 192.0.2.53
IP4.DOMAIN[1]: example.net
Illustrative output — exact values vary by system and data.
Official sources