Jump to content

  • Log In with Google      Sign In   
  • Create Account


How to make my pc host "mygame.com"


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
9 replies to this topic

#1 FXACE   Members   -  Reputation: 182

Like
0Likes
Like

Posted 16 May 2012 - 01:09 PM

Hi folks!

I'm trying to make PC host "mygame.com" (for example) on Windows XP Proffesional SP2. My actions:
1. My Computer -> (rigth mouse button) -> Settings.
2. Going to "Computer name".
3. Clicking on button "Change computer name". It opens a new window "Changing computer name".
4. On edit control typing: "mygame".
5. Clicking on button "Advanced". It opens a new window "DNS-suffix and NetBIOS-computer name".
6. On edit control typing: "com".
7. Pressing "OK". It closes a window ("DNS-suffix and NetBIOS-computer name").
8. Now on "full pc name" label I see: "mygame.com".
9. My pc is a member of a working group "LAN" (Does it make any sense?).
10. Pressing "OK". It closes a window ("Changing computer name") and Windows asks for restart pc.
11. Restarting pc.
12. Checking host by code: "HOSTENT *hostent = gethostbyaddr(<my ip-address given by internet provider>)" and it returns: "hostent->h_name : mygame.com".
13. Now, I'm trying to ping to my pc by this name: Command Promt = "ping mygame.com" and it's works as expected (it shows my ip-address).
14. Next step, also testing: creating a socket and binding to port 80 (default HTTP port) and debug/waiting for incoming packets.
15. On any web-browser on address line typing: "mygame.com". On loading my "web-server" catches this connection, so I can send a HTTP response which works too.

The problem is another pc which is connected to the internet can't find my pc by host name "mygame.com". (#13, #14 and #15 actions are fail).
I had searched any tips about that but nothing found to fix that.
The main question is how to tell to other PCs that host name "mygame.com" is my system(pc)?
Many resources which are closure to my topic, in conclusion: "You need Windows Server ($$$), network routers and other software which would be useless, I thing".

(P.S. "mygame.com" is just example. In real, I used host which is currently not busy)

Thanks forward for any help!

Edited by FXACE, 16 May 2012 - 01:13 PM.


Sponsor:

#2 SimonForsman   Crossbones+   -  Reputation: 5804

Like
0Likes
Like

Posted 16 May 2012 - 01:33 PM

You need to register the domain to get public DNS servers to forward traffic to it properly.
This is done through a registrar, there are plenty of them to choose from. (Prices vary aswell, some top domains are cheaper than others)
I don't suffer from insanity, I'm enjoying every minute of it.
The voices in my head may not be real, but they have some good ideas!

#3 hplus0603   Moderators   -  Reputation: 4978

Like
1Likes
Like

Posted 16 May 2012 - 01:55 PM

Changing your own machine only changes what it thinks -- it doesn't change what the billions of other computers in the world thinks.

The rest of the world needs to get an IP address that maps to your machine in order to communicate with your machine. This IP address is generally assigned by your ISP (Comcast, Verizon, whoever is your internet provider.) Thay may also decide to change this IP address at any time without telling you, unless you pay them for a "static IP service," which in turn generally needs a "business internet" plan rather than a "consumer internet" plan. Additionally, the IP they issue will generally point at your modem or router/firewall, rather than your PC. Thus, you have to set up port forwarding from the firewall to your PC for the port that your game listens on, for the packets to actually get to your PC.

The mapping from "somedomain.com" to the actual IP address is done through the global DNS system. To insert your own name into this system, you typically pay a registrar some money per year to matain this mapping. Expect to pay between $8/year (for the ultra-cheap, crappy registrars like GoDaddy) to $50/year or more (for the value-added, high-service options.) Personally, I use Dreamhost, for $10/year, but you also have to have a hosting account with them for that to make sense. The problem here is that the name -> IP mapping can't change very quickly, so if your ISP changes your IP address (because you didn't pay for a static address,) your players will get "could not connect" errors, or maybe someone else spins up an evil server on the IP that you used to use...

There exists a way to map from a static name to a dynamic IP; "dynamic DNS." The most well-known service is probably DynDNS.org. The way it works is that you set up your PC or firewall to update DynDNS.org whenever your IP changes. This maps a name called something like "yourgame.dyndns.org" to an IP address. You then set up a name redirect for your "real" domain -- "yourgame.com" -- to the "yourgame.dyndns.org" name. This is done with a CNAME record, and most good domain registrars should let you set one of these up.

With all of these machinations, you can get "yourgame.com" to map to your PC, and it needn't cost you more than $10/year. However, there are several draw-backs to this set-up:
- If you accidentally kick the power cord of your PC, it will kill the game server. Or your cat/spouse/cleaning-lady/power-company/whatever.
- If somebody doesn't like you or one of your players, they may decide to start a DDoS against you by renting a botnet for a few hours. This may make your ISP disconnect your consumer Internet service, and will certainly take down your game.
- If you need to use the PC for something else, then you have to disconnect current players.
- Some of the service providers involved (like your ISP) may have policies against this, or may suddenly change their services, and you'll be unable to stay online.

If you want to run your game as a serious undertaking, the best thing to do is to pay for a hosted, or co-located, or virtual private server. This costs from $20/month and up, depending on bandwidth and CPU/RAM/storage needed. These machines run in well-managed data centers, and can generally have a static IP that you can map yourgame.com to. Providers include aws.amazon.com Elastic Compute Cloud, serverbeach.com, linode.net, interserver.net, 1and1.com, dreamhost.com, and many others.

Note that you want a "hosted server" of some sort, not a "web server." Also, if your server is written for Windows, expect to pay more per month, to cover the Windows license, and not all service providers support Windows, so make sure to check for that!

enum Bool { True, False, FileNotFound };

#4 FXACE   Members   -  Reputation: 182

Like
0Likes
Like

Posted 18 May 2012 - 08:51 AM

There exists a way to map from a static name to a dynamic IP; "dynamic DNS." The most well-known service is probably DynDNS.org. The way it works is that you set up your PC or firewall to update DynDNS.org whenever your IP changes. This maps a name called something like "yourgame.dyndns.org" to an IP address. You then set up a name redirect for your "real" domain -- "yourgame.com" -- to the "yourgame.dyndns.org" name. This is done with a CNAME record, and most good domain registrars should let you set one of these up.


That's would be a "subdomain", I think...

If you want to run your game as a serious undertaking, the best thing to do is to pay for a hosted, or co-located, or virtual private server. This costs from $20/month and up, depending on bandwidth and CPU/RAM/storage needed. These machines run in well-managed data centers, and can generally have a static IP that you can map yourgame.com to. Providers include aws.amazon.com Elastic Compute Cloud, serverbeach.com, linode.net, interserver.net, 1and1.com, dreamhost.com, and many others.


I currently found http://www.000webhost.com/ which costs 5$/month with unlimited bandwidth and storage.

Thanks for detailed explation and ideas on how to do that, hplus0603, I really appreciate it!

EDIT: I'm also wondering how to prevent DDoS attack from users (and how hosting services avoiding damages, if they can)?...

Best wishes, FXACE.

Edited by FXACE, 18 May 2012 - 08:57 AM.


#5 Antheus   Members   -  Reputation: 2393

Like
1Likes
Like

Posted 18 May 2012 - 09:20 AM

I currently found http://www.000webhost.com/ which costs 5$/month with unlimited bandwidth and storage.


That's a web host. It's for serving HTML pages via PHP. Are you sure this is what you need?

Also - unlimited is never unlimited.

I'd be very careful of hosts that do not disclose exactly what the limits are upfront. Othewise they can easily bill you at the end of the month. Or, if they use shared bandwidth, then there are 1000 servers sharing a 10MBit link, meaning they'll often be inaccessible or very slow.

It's also common for such "free" hosts to simply terminate your account if you exceed some unwritten quota.

EDIT: I'm also wondering how to prevent DDoS attack from users (and how hosting services avoiding damages, if they can)?...


It depends. Some just bill you for traffic, others disconnect your server, third don't care, your site just isn't accessible.

There is nothing you can do about it, unless you create your own hosting environment with multiple backbone providers for peering so that you can route DDoS and switch to different networks/links as needed. But at lower end, there isn't much you can do, AWS can be used to bring down many such servers for free.

Hosts with uptime guarantees start at some $500/month. DDoS resistant hosting is much more.

Edited by Antheus, 18 May 2012 - 09:22 AM.


#6 hplus0603   Moderators   -  Reputation: 4978

Like
1Likes
Like

Posted 18 May 2012 - 11:20 AM

I'm also wondering how to prevent DDoS attack from users


You have to have smarter routers/filter and better bandwidth than your attacker. A good botnet can push 25-50 Gbps of traffic your way, so solving that problem is not cheap. If you're just starting out, your main concern should be to avoid financial catastrophe, should this happen. Typically, this means establishing enough channels upstream that traffic to your service can be turned off BEFORE it hits the link where you pay for it. In a co-location facility, this would be your upstream ISP. In a managed hosting situation, you have to talk to the managed hosting people to have them talk to their own upstream vendors, which is generally harder.

For DDoS mitigation, there are services that can take over packet ingress and do mitigation for you. Typically, you pay some amount of money up front for the service, and then pay additional usage fees if/when you actually use it. Signing up for such a service requires you to already be pretty big and know how your data center operates, as well as have good relations with your upstream ISP, though -- not something a one-server garage outfit will generally do.

http://www.ultradns.com/ddos-protection/siteprotect/what-is-siteprotect
http://www.akamai.com/html/solutions/ddos_defense.html
http://www.verisigninc.com/en_US/products-and-services/network-intelligence-availability/ddos/mitigation-services/index.xhtml

Honestly, if you focus on making a fun game that people want to play, you'll probably be able to solve those higher-order problems once you actually need to :-)

enum Bool { True, False, FileNotFound };

#7 FXACE   Members   -  Reputation: 182

Like
0Likes
Like

Posted 18 May 2012 - 06:24 PM

That's a web host. It's for serving HTML pages via PHP. Are you sure this is what you need?


With this I can manage a NAT server (which would have a list of active servers, created by users, where you can connect to)...
Doing HTTP requests/response on application is not a hard work, I think. Besides, you can send/recieve binary data over HTTP (not just HTML pages), HTTP's header "Content-Type" tells what kind of data is incoming/outcoming, you can use a type which is specified in documentation or you can specify your custom type which would not be supported on web-browser (they usually notify this data as file to download, or just print them out to screen) but it doesn't change byte values.

And this can be used to download game data from...

But it's probably easy to crack.

Also - unlimited is never unlimited.

Yes, you are right. Maybe hosting service wants to tell you that HDD-space is their problem and how much space must be to handle your data.
Also - I think that some servers of hosting services in real are not look as they are shown in advertising (pictures).

I'd be very careful of hosts that do not disclose exactly what the limits are upfront. Othewise they can easily bill you at the end of the month. Or, if they use shared bandwidth, then there are 1000 servers sharing a 10MBit link, meaning they'll often be inaccessible or very slow.

Yes, you need to read a contract carefully before accept, not to get into traps. And how much percent it would be true on how fast is it works (hosting provider's secret)...


It's also common for such "free" hosts to simply terminate your account if you exceed some unwritten quota.

Yes, they do that. But, they are warn before they do it, and ask you "do you need this host or not?". And if this host is not pinned "under construction", etc. That's if you are using a free account. But, as they say, in "pro-account" which would cost 5$/month, they would never do that (if it is not violating state rights).

It depends. Some just bill you for traffic, others disconnect your server, third don't care, your site just isn't accessible.

Hmmm, I just knew about billing a traffic. Can you give me more information about how they can disconnect a server if you can?
But there is one way to shutdown a server is to write a letter of complaint to hosting provider on which this server is rent. And for hosting services is probably hard to check whether this reason described in letter is true or not, they will close server. Some people did success by this way.

Honestly, if you focus on making a fun game that people want to play, you'll probably be able to solve those higher-order problems once you actually need to :-)

I just want to make a nice, funny, with WW2 theme, strategy game. Players would not play against each other. For example, you have a team (you and your friends) and play levels, pass all missions, where you can feel yourself like rambo, etc. Each mission is planned to be passed in co-operative. As this planned to be an internet game, I'm managing online voice speak (using microphone, delay between you say something and others would hear you is 0.4 seconds, because buffer is need to be filled before send), visualization instruments where you can explain your ideas, tactics and actions, because things like text-chat is useless, while you are trying to tell something to another player the moment has gone.

And for little price from which developers and designers can live.

Who would be interested to crack this game? There are two kinds of people:
1. who enjoy cracking applications.
2. who has a special order to crack applications (usually from black-side bussiness owners or company opponents)...


Thank you guys for all replies.
Best wishes, FXACE.

Edited by FXACE, 18 May 2012 - 06:28 PM.


#8 hplus0603   Moderators   -  Reputation: 4978

Like
0Likes
Like

Posted 19 May 2012 - 12:18 AM

First: if you think you'll get "unlimited" anything for $5/month, you are fooling yourself. It may be good enough for a web page, and/or a matchmaking/game listing service, but don't expect to stream a couple of terabytes of data a month on that system. Also, don't expect snappy web script responses on that web host shared with 1,000 other customers.

Second:

With this I can manage a NAT server


No, you cannot. A NAT introducer server (for NAT punch-through) requires careful control of the source and destination ports for both ends of the connection, as well as a persistent connection between each client and the server while introducing. HTTP gives you none of that. Especially if you want to use UDP, which HTTP can't do at all. (NAT introduction doesn't work nearly as well for TCP connections, either)

A HTTP server can work fine as a "game lister," where players hosting games can list their servers, assuming those players know how to properly set up port forwarding. Maybe that's all you need, and if so, go right ahead and build it on a web host! If it ever doesn't work right, you can always choose to pay more for better service later (assuming you have a domain registration you can point at any server you want.)
enum Bool { True, False, FileNotFound };

#9 FXACE   Members   -  Reputation: 182

Like
0Likes
Like

Posted 19 May 2012 - 04:37 AM

First: if you think you'll get "unlimited" anything for $5/month, you are fooling yourself. It may be good enough for a web page, and/or a matchmaking/game listing service, but don't expect to stream a couple of terabytes of data a month on that system. Also, don't expect snappy web script responses on that web host shared with 1,000 other customers.

Yeah, that's a problem, because that would not be. How expensive hosting providers can deal with that?





With this I can manage a NAT server


No, you cannot. A NAT introducer server (for NAT punch-through) requires careful control of the source and destination ports for both ends of the connection, as well as a persistent connection between each client and the server while introducing. HTTP gives you none of that. Especially if you want to use UDP, which HTTP can't do at all. (NAT introduction doesn't work nearly as well for TCP connections, either)


Well, when I said to manage NAT server I didn't mean it literally... (I really think about just right as you mentioned as "game lister")

Best wishes, FXACE.

Edited by FXACE, 19 May 2012 - 04:53 AM.


#10 hplus0603   Moderators   -  Reputation: 4978

Like
0Likes
Like

Posted 19 May 2012 - 10:41 PM

How expensive hosting providers can deal with that?


You pay for what you use. For example, if you lease some number of full servers (or put your own servers in a co-location facility,) then you know that nobody else will share those same resources.

When it comes to bandwidth, you typically commit to a particular amount. For example, you may commit to 50 Mbps of bandwidth, and pay a fixed rate of perhaps $500 per month for that. The ISP will make sure that that much is available for your use. Typically, the ISP bandwidth will show up at your head-end router, and you will use metrics on that router to make sure that you get the service you're paying for (and don't exceed it.)
Typically, what you actually pay for is the "95th percentile" bandwidth -- this means that the ISP will measure your bandwidth over time, say per minute, or per five minutes, and will sort these minutes from lowest usage to highest usage. The usage that covers 95% of all minutes is the one that you pay for. This allows you to temporarily exceed the allocated bandwidth, as long as you do that less than 5% of the time. Other mechanisms for billing also exist -- best is to talk to the people in your data center once you get to that point.

For an intermediate option -- higher quality than shared hosts, but not full-out co-located with your own stuff -- look at self-managed servers. These typically cost between $50/month and $500/month, and come with some amount of bulk bandwidth (typically a 10 Mbps port and 2 TB of bandwidth per month -- it's really hard to exceed 2 TB on a 10 Mbps port :-) You get remote access to the "raw" server, running in their data center, perhaps with an OS installed, and you take it from there. Another variant of this option is the "virtual private server," where virtualization (such as VMWare, Xen, Hyper-V, etc) is used to "slice" a server into many smaller servers, and those servers are in turn rented on the same "remote access" basis.

enum Bool { True, False, FileNotFound };




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS