How does my computer and x.x.x.x know how to talk to each other?
They don't really. But they know who to ask.
Routing is a collective effort. Most routers gateways only know a small number of other routes and gateways. Only few routers need to know all routes.
A greatly simplified view:
Your computer sees by the destination IP that the destination is ...
How does my computer and x.x.x.x know how to talk to each other? If I
use a human messengers analogy, I would tell a person to go get me a
package, and I would give him the address of the location and a map
(he probably already have one).
Exactly, an IP packet has both the source and destination IP addresses on it, much like the envelope of a letter.
Keeping a DNS record private doesn't provide much security. An outsider able to "guess" the host name and IP address could access the service. You should consider limiting access by source IP addresses on your firewall, at the very least. Using VPN for securing access is highly recommended.
If you're already forwarding a port from a public IP ...