I'd like to know which name servers are asked for a name, when I try to connect to a local device by name. Is it possible? I have a local DNS, which mostly works fine, but sometimes not.
For example, I can ping web.home.myname
(myname=an own TLD, not a real one), or I can access this site from Android browsers if I'm connected to my Wifi. But can't when I'm connected to LAN via my own VPN, although the OpenVpn server pushes DNS settings to clients.
I'd like to see what's happens when I'm using VPN, but every DNS tools are using Google's DNS, instead of local server. Even if I'm connected to my Wifi (when I can access lan devices by name).
I'm trying to explain by real examples.
I have an Asus router with stock firmware, which acts as router, Wifi AP, DHCP server, DNS forwarder, firewall, OpenVpn server and PPPOE client. I have a server with many docker containers, including a container which runs dnsmasq. It is my main DNS, this is the only one, which can resolve the local domain names. I've configured DHCP on the router, to send the container's IP to clients as DNS server.
When my mobile connects to the AP, all apps run on this device, can access local devices by name. Because of it, I think, Android is able to use my own DNS server instead of Google's.
But... when I connect to the OpenVPN server (from the Internet), which runs on the router, I can access LAN devices by IP address, but not by name (with 3rd party firmware it works fine).
The VPN server has been configured to push the DNS settings to the clients but it doesn't work.
That's why I'd like to see, how are the names resolved, which DNS servers are asked when an app tries to access devices by name. The tried tools connect directly to 8.8.8.8, but the browsers and programs in termux app aren't, because they can access lan devices by name if the mobile is connected to the Wifi.
Ps: the mobile isn't rooted