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 firstname.lastname@example.org
Name resolution for the forwarding happens at the destination end of the tunnel.
I just double-checked this:
ssh -L 2222:webserver:22 email@example.com
`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:
firstname.lastname@example.org:~# tshark -f 'host 126.96.36.199'
Running as user "root" and group "root". This could be dangerous.
Capturing on 'ens3'
1 0.000000000 NNN.NNN.NNN.NNN → 188.8.131.52 DNS 71 Standard query 0x9521 A mywebserver.xyz
2 0.000033057 NNN.NNN.NNN.NNN → 184.108.40.206 DNS 71 Standard query 0xb533 AAAA mywebserver.xyz
3 0.003754670 220.127.116.11 → NNN.NNN.NNN.NNN DNS 143 Standard query response 0xb533 AAAA mywebserver.xyz SOA max.ns.cloudflare.com
4 0.003786821 18.104.22.168 → NNN.NNN.NNN.NNN DNS 98 Standard query response 0x9521 A mywebserver.xyz A 22.214.171.124
(real IP addresses replaced with `NNN.NNN.NNN.NNN`)