python – How do I create a server that anyone on another network can connect to?

I’m new to this networking stuff, and I want to know how I create a server, for example with sockets in python, that anyone can connect to. If I create a dns server, would that solve the problem? And how do I create a dns server that anyone can join?

I tried to make a TCP server using socket with python, it went good, but, nobody can connect with it, only my friend using Radmin :(. How can we connect to google? I know what is dns, but i think is not all!! Google has an IP, everybody has, i tried to make a server with my public IP, but it went bad. If i put the google’s ip in my browser i’ll connect to google, so, dns is just an easy way to connect with websites. How can wu connect to google using just an IP??!! I need help, i’ve searched all day, but, i found nothing!!