Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

For starter, let me say that servers and stuff like that are really not my strong point, so I'll try to explain myself as I can because I forgot the name of the thing I'm trying to do.

Let's say in my browser I type http://something

I know there is a place somewhere where I can say "something means 140.254.23.10" and then make the appropriate redirection.

What's the name of this thing? How do I set that in MacOS and Windows?

share|improve this question

2 Answers 2

up vote 5 down vote accepted

In case you just need this on your local machine, say for overriding dns info or for testing a system that has no dns entry yet, you could use this:

Open the file

%SystemRoot%\system32\drivers\etc\hosts
in notepad and add a line similar to this:

w.x.y.z          mysite.com

You must replace w.x.y.z with the ip address you want to connect to of course.

See http://en.wikipedia.org/wiki/Hosts%5Ffile for further details.

share|improve this answer
    
On the Mac (and other *nix based OSes) the file would be /etc/hosts and has the same format as windows. (For the record, Windows stole the format from Unix. ;-) –  Chris Nava Nov 24 '09 at 17:06

DNS, I think you mean. In Windows it's in your network settings for TCP/IP. Set your DNS server to point to the correct DNS server, whether it's your home router or what your ISP tells you to set it to.

Usually this is handled automatically if you're running DHCP and your router is already properly configured.

Domain Name Service.

Edit: you might want to find more by googling something like "set dns server" along with your operating system name. This should yield some directions for you.

share|improve this answer
    
Isn't there something where I could manually set that and not use a server? Let's say I want that typing "xyz" in my browser redirects me to localhost (or some other IP), can I do that? –  marcgg Nov 24 '09 at 13:07
    
Thanks to your directions I found the file on windows: %SystemRoot%\system32\drivers\etc\hosts ! Thanks a lot, that solved my problem –  marcgg Nov 24 '09 at 13:14
    
You're welcome. The hosts file is a way of statically mapping for a particular client machine, yes. Just remember you made that change or a few months from now you'll scratch your head why one machine is acting the way it is for searching for things online :-) DNS servers are a more convenient way of doing this for many machines on a network centrally. –  Bart Silverstrim Nov 24 '09 at 13:19
    
I ended up accepting fuero's answer because it's actually what I did do to set it up. But thanks again :) –  marcgg Nov 24 '09 at 13:22

Your Answer

 
discard

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.