Page 1 of 1

Local Domain-Name to IP mapping?

Posted: Wed May 14, 2008 5:03 pm
by Sergeant Thorne
Is it possible to modify a file on my PC to map a domain name to a certain IP address?

I thought I'd read about it in the past, as a solution to domain-name updates that hadn't yet rippled out to an individual's area.

I realize that this would only effect me, but that's exactly what I'm looking for. I want to be able to work with my local test-sites whenever my internet connection goes down.

I'm running an apache server here on my main machine, and the separate sites are configured as virtual hosts, so whenever the net goes down I have no way of accessing them.

Posted: Wed May 14, 2008 5:40 pm
by CDN_Merlin
HOSTS file. Search for it. It's a text file with no extension. Samples are included in file.

Re: Local Domain-Name to IP mapping?

Posted: Wed May 14, 2008 5:41 pm
by heftig
Check out the file %SystemRoot%\\System32\\Drivers\\etc\\hosts .

Posted: Wed May 14, 2008 6:04 pm
by Krom

Code: Select all

# Copyright (c) 1993-1999 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
#      102.54.94.97     rhino.acme.com          # source server
#       38.25.63.10     x.acme.com              # x client host

127.0.0.1       localhost
#192.168.1.200 krom.d3k.org
Use # to comment out a line for easier editing if you do frequent changes.

Re:

Posted: Thu May 15, 2008 5:07 am
by The Lion
Krom wrote:

Code: Select all

# Copyright (c) 1993-1999 Microsoft Corp.
Be careful, you might get sued. :)

Posted: Mon May 19, 2008 1:26 pm
by Sergeant Thorne
Excellent! Thanks a lot guys.