Use DDNS as TCP Server RRS feed

  • Question

  • Asalam Alaikum!(Greetings)

    I would like to know that is there any procedure where i can make a DDNS IP into TCP Server.

    I use Dns.Resolve(""), it returns an IP, i want to use that IP and Port of my PC to communicate with TCP Server. Is there any way to do so, kindly help.

    Muhammad Naveed Haroon

    Tuesday, July 23, 2019 1:10 PM

All replies

  • Your question is confusing.  You've asked it in several contradictory ways.

    Do you want your PC to be able to contact a TCP server, or do you want your PC to be a TCP server at the dynamic address?  Those questions have very different answers.

    If you want to contact a TCP server, then you don't need your external IP address at all.  Just create a TCP socket and bind to the address, just like normal.

    If you want to offer a TCP server to the internet, you still do not need your external IP address.  Your router or gateway will receive packets from the outside.  You will need to tell the router that packets from the dynamic address should be routed to your PC.  It will do address translation, so your PC will only see its internal IP address (usually 192.168.x.x or 10.x.x.x).

    So, your TCP server program just needs to bind to your selected port using the IP address of your computer, which you can get with Dns.GetHostEntry(Dns.GetHostName).  The router will make sure packets get to you.

    Tim Roberts | Driver MVP Emeritus | Providenza & Boekelheide, Inc.

    Tuesday, July 23, 2019 5:17 PM