Reach an external IP address/FQDN from docker swarm

I have created a 5 node swarm 3 managers 2 nodes. I would like to access an external IP from one of the managers. I tried creating an overlay network but i could not access. Also i tried to configure the overlay so that i can pass a DNS server for DNS resolution forwarding. How can i go about it

A container should be able to reach external IPs, as long as the node it runs on has a route to the target network or to an internet break out, and no firewall prevents the connection to established. If this already is not working, ofc it will not work with a dns name either.

Docker’s build in dns-server will use the resolvers configured on that node as upstream resolver(s). So if the resolver(s) is/are able to resolve the external fqdn, it should work out of the box. If you want to inject an otherwise unresolvable fqdn, you could leverage extra_hosts.