In local port forwarding, what DNS server resolves the name of internal_db.local?
Would that be the internal SSH server's DNS? (that's what I would think)
Or is it the external DNS server that assigns the sshgateway.com its address?
ssh -L 4000:internal_db.local:3306 email@example.com
Name resolution for the forwarding happens at the destination end of the tunnel.
I just double-checked this:
ssh -L 2222:webserver:22 firstname.lastname@example.org
`webserver` doesn't resolve to anything locally but I was able to connect through the port forward using:
ssh root@localhost -p 2222
Alternatively you can check this with tshark for a public name, running during the connection to the remote server via the tunnel:
email@example.com:~# tshark -f 'host 18.104.22.168'
Running as user "root" and group "root". This could be dangerous.
Capturing on 'ens3'
1 0.000000000 NNN.NNN.NNN.NNN → 22.214.171.124 DNS 71 Standard query 0x9521 A mywebserver.xyz
2 0.000033057 NNN.NNN.NNN.NNN → 126.96.36.199 DNS 71 Standard query 0xb533 AAAA mywebserver.xyz
3 0.003754670 188.8.131.52 → NNN.NNN.NNN.NNN DNS 143 Standard query response 0xb533 AAAA mywebserver.xyz SOA max.ns.cloudflare.com
4 0.003786821 184.108.40.206 → NNN.NNN.NNN.NNN DNS 98 Standard query response 0x9521 A mywebserver.xyz A 220.127.116.11
(real IP addresses replaced with `NNN.NNN.NNN.NNN`)