Saturday 13 June 2015

Kubuntu DNS settings

Seem like DNS settings are no longer stored in resolv.conf but this can still be extracted from the netwok Manager CLI.


nmcli dev show [device] e.g. nmcli dev show wlan0


This will return information including:

IP4.DNS[1]:
IP4.DOMAIN[1]:

Therefore a quick awk can return the value needed:


nmcli dev show wlan0 | grep IP4.DNS | awk -F: '{ print $2 }' | awk '{ print $1 }'



No comments:

Post a Comment