Смотрите мой DNS Server Linux
grep "nameserver" /etc/resolv.conf
Clever Capybara
grep "nameserver" /etc/resolv.conf
systemd-resolve --status