Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Im working on an online game, but I'm having an annoying issue with me and my friend testing. The thing is, I set the client to connect to my WAN IP so he can connect, but then I cannot connect as it only work with localhost or If I set it to localhost, obviously he cannot connect.

I also tried using a DNS server, which used to work but recently I set it up again and it's not working.

Any ideas on how I can get a single domain or IP that works for a local connection and a WAN connection?

share|improve this question

migrated from Jun 18 '11 at 9:36

This question came from our site for professional and enthusiast programmers.

up vote 2 down vote accepted

Add an entry to your hosts file.

In your hosts you can write: thegame

and your friend can write: [your wan ip] thegame

Then you can both connect to thegame.

share|improve this answer
Wow thanks, I'm pretty sure this is what I did last time when it was working and forgot to add it after I formatted my PC. Thanks again – Brad Jun 18 '11 at 7:20

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.