Jump to content
  • Advertisement
Sign in to follow this  
LiceFork

Using domain name as server...

This topic is 4164 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey, I'm working on an FPS... and I want it to be complete with online multiplayer. I've done extensive research on networking for the past few weeks, learnt about NAT push-through and the works. It seems to be my only way to go... but I already have a website (www.no-residue.net) and I don't want to pay for additional hosting for just my server. I've heard you can connect to a web domain instead of an IP to work around NAT. I've checked the Forum FAQ and everything... but there seems to be no answer. I know it can be done, otherwise things like Battle.net would not exist. My question is... how? I've tried to connect to my server on a random port but it won't bind. Help..??? p.s. I know C/C++ in and out, and i'd prefer the possible solution to be coded in C/C++, please. If there's a solution in Java, I'm more than willing to learn Java if it will work ^_^

Share this post


Link to post
Share on other sites
Advertisement
1)Why do you feel you need to use a NAT push thru technique?
2)Do you pay for domain-name hosting, and host the web-site yourself, or do you pay for hosting of the site data as well?
3)How are you trying to connect to your server (on a random port)?
4)What language are your server and client programs written in?

[edit]
I went to your site, and it seems you're paying dreamhost.com to register your domain name, point that domain to the IP of one of their servers, which then hosts your PHP website. Is this right?

From your post it seems you want to run a C++ game server on your domain. I doubt your hoster will allow you to upload an executable and run it on their servers.

I think you're out of luck unless you want to write your game server in PHP/Ruby/MySQL...

Share this post


Link to post
Share on other sites
I know PHP, but I figured writing the server that way would be too slow, or am I wrong? I was also looking around and ran into DynDNS, would that be a good solution? Thanks for your reply!

Im running a Linux box, and my hoster runs Unix/Linux systems.
Server/Client/Game all written in C++.

Share this post


Link to post
Share on other sites
You can try and convince your hoster to allow you to telnet into their servers and execute your game server, but that's unlikely, as its a big security issue for them (not to mention the CPU time, RAM, etc that your server will use).


Alternatively you could host the server on your own Linux PC at home, and point a domain name to that computer. I've been doing this myself using a windows machine and the free service at http://freedns.afraid.org/

As long as you have enough bandwidth (10mbit/s would be nice!), and dont mind leaving your PC on 24/7 it should be ok

Share this post


Link to post
Share on other sites
Thanks :D FreeDNS and DynDNS seem to do the same thing, I will try them both. One more question... so if I run my server on my local machine w/ ip: 192.168.1.36 (because it's behind a NAT router) and I use my domain, it will foreward packets to my server on THIS machine? If that is correct, you have solved my problem :)

Share this post


Link to post
Share on other sites
You need to configure your router to forward all packets received on a certain port (your game's port) to your local (internal) IP.

Then you point the dynDNS to your external (given by www.whatismyip.com) address.

This way, you'll be able to configure your game to use a single address (www.mygame.com).

If you're then unable to run the game from within your local network (may happen), instead of changing the configuration, you are perhaps better off adding a line to your hosts. file. Something similar to "192.168.1.36 www.mygame.com", and this way you'd get proper IP if your router doesn't cooperate, or gets confused.

Share this post


Link to post
Share on other sites
Quote:
Original post by LiceFork
Thanks :D FreeDNS and DynDNS seem to do the same thing, I will try them both. One more question... so if I run my server on my local machine w/ ip: 192.168.1.36 (because it's behind a NAT router) and I use my domain, it will foreward packets to my server on THIS machine? If that is correct, you have solved my problem :)


no it won't,

you need to configure your router to forward all traffic on a specific port or port range to 192.168.1.36.

also you should be able to use whatever.no-residue.net for your server without any problems (or extra costs if you choose dns host wisely (you don't have to have the same host for your website and your domain).

if you intend to have people playing on your server you should preferably have a fiber or ethernet connection (dsl and cable generally have crappy upload speeds and are thus very unsuitable for game server hosting)

Personally i would suggest writing a simple php/asp/jsp serverlist server (Its not that demanding and would run fast enough on a normal webhost unless your game is insanely popoular (in which case rewriting it or switching to a better host would be trivial), The actual game servers can then be hosted by the players (ofcourse you can still host a few servers)

Share this post


Link to post
Share on other sites
Yeah.. I have a ZyXEL router, and I used Telnet to try and configure port-forwarding. It's really screwed over, I can't even simply just paste the gateway IP into my browser, I HAVE to use Telnet, but it's really confusing. I'll probably end up calling my ISP. Thanks for the help!

Share this post


Link to post
Share on other sites
Quote:
Original post by LiceFork
Yeah.. I have a ZyXEL router, and I used Telnet to try and configure port-forwarding. It's really screwed over, I can't even simply just paste the gateway IP into my browser, I HAVE to use Telnet, but it's really confusing. I'll probably end up calling my ISP. Thanks for the help!


Since you are running linux (or have a linux box atleast).

1) Make sure your linux box has 2 network adapters
2) Get a switch
3) Connect Adapter A to the switch and Adapter B to the internet.
4) Use iptables to set-up the firewall/router
5) Throw out the ZyXEL router.
6) Connect all other computers to the switch.

another option is to simply get another router (even the really cheap ones (20-50 euro) have web interfaces today.

Share this post


Link to post
Share on other sites
Well since I'm going to be buying a seperate computer to run the server on, I'll buy a new router! The ZyXEL is for my computer illiterate family, and the server's gonna be hosted at a seperate location (unfortunatelly, that location uses the SAME router!). Thanks all :)

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!