ubuntu 20.04 how to check dns server

C++
systemd-resolve --status | grep Current
Source

Also in C++: