elephantintheroom
elephantintheroom

Reputation: 165

Resolving DNS with winsock, with server behind router

I recently started to play around with sockets in windows and I ran into a bit of trouble.. I have an application that I want to find a host with DNS name resolution (through an internet connection).

The program manages to resolve the DNS name to an IP address, but the IP address it finds is the one of the router that sits in front of the computer that runs the server application(which is what I expect, since it is the default gateway)..

My question would be if there is a way to connect to the server application without having to modify the router's settings by hand every time the server application is installed on a system that has a router sitting in front of it.. Or is the only way to do this to somehow forwarding the port of the computer to the router ?

Any help is appreciated! Thnx!

Upvotes: 0

Views: 963

Answers (1)

Remy Lebeau
Remy Lebeau

Reputation: 597036

If the server is behind a router, then the router has to be configured for Port Forwarding. There is no getting around that. The router needs to know which machine on its network to forward incoming client requests to for any given port. However, depending on the type of router and its features, the server app might be able to configure the Port Forwarding programmably using uPNP or SNMP, if available and enabled. Otherwise, the router has to be configured by hand by the router admin.

Upvotes: 2

Related Questions