shell bash add tag
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 its address?

For example:

ssh -L 4000:internal_db.local:3306

Top Answer
Jack Douglas
Name resolution for the forwarding happens at the destination end of the tunnel.

I just double-checked this:

``` shell
ssh -L 2222:webserver:22

`webserver` doesn't resolve to anything locally but I was able to connect through the port forward using:

``` shell
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:

``` shell tshark -f 'host'
Running as user "root" and group "root". This could be dangerous.
Capturing on 'ens3'
    1 0.000000000 NNN.NNN.NNN.NNN →      DNS 71 Standard query 0x9521 A
    2 0.000033057 NNN.NNN.NNN.NNN →      DNS 71 Standard query 0xb533 AAAA
    3 0.003754670 → NNN.NNN.NNN.NNN DNS 143 Standard query response 0xb533 AAAA SOA
    4 0.003786821 → NNN.NNN.NNN.NNN DNS 98 Standard query response 0x9521 A A

(real IP addresses replaced with `NNN.NNN.NNN.NNN`)

Enter question or answer id or url (and optionally further answer ids/urls from the same question) from

Separate each id/url with a space. No need to list your own answers; they will be imported automatically.