If you’re using Ubuntu 18.04+ (or distro based on Ubuntu 18.04) and you would like to know which DNS servers are responsible for your connection, you can try the next options:
nmcli dev show | grep DNS
IP4.DNS: 192.168.15.15 IP4.DNS: 192.168.15.16 IP4.DNS: 192.168.15.17
.... DNS Servers: 192.168.15.15 192.168.15.16 192.168.15.17 DNS Domain: ~.
It contains a list under “DNS Servers” organized by link
The well known file /etc/resolv.conf is now just a symlink to /run/systemd/resolve/stub-resolv.conf
If you want the “old way”, you can point /etc/resolv.conf directly to /run/systemd/resolve/resolv.conf