Local Domain-Name to IP mapping?

For system help, all hardware / software topics NOTE: use Coders Corner for all coders topics.

Moderators: Krom, Grendel

Post Reply
User avatar
Sergeant Thorne
DBB Material Defender
DBB Material Defender
Posts: 4640
Joined: Sun Nov 25, 2001 3:01 am
Location: Indiana, U.S.A.

Local Domain-Name to IP mapping?

Post 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.
User avatar
CDN_Merlin
DBB_Master
DBB_Master
Posts: 9750
Joined: Thu Nov 05, 1998 12:01 pm
Location: Capital Of Canada

Post by CDN_Merlin »

HOSTS file. Search for it. It's a text file with no extension. Samples are included in file.
User avatar
heftig
DBB Ace
DBB Ace
Posts: 138
Joined: Mon Jun 05, 2006 9:55 pm
Location: Germany
Contact:

Re: Local Domain-Name to IP mapping?

Post by heftig »

Check out the file %SystemRoot%\\System32\\Drivers\\etc\\hosts .
User avatar
Krom
DBB Database Master
DBB Database Master
Posts: 16042
Joined: Sun Nov 29, 1998 3:01 am
Location: Camping the energy center. BTW, did you know you can have up to 100 characters in this location box?
Contact:

Post 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.
User avatar
The Lion
DBB Ace
DBB Ace
Posts: 197
Joined: Mon Apr 17, 2006 2:13 pm
Location: The Netherlands

Re:

Post by The Lion »

Krom wrote:

Code: Select all

# Copyright (c) 1993-1999 Microsoft Corp.
Be careful, you might get sued. :)
User avatar
Sergeant Thorne
DBB Material Defender
DBB Material Defender
Posts: 4640
Joined: Sun Nov 25, 2001 3:01 am
Location: Indiana, U.S.A.

Post by Sergeant Thorne »

Excellent! Thanks a lot guys.
Post Reply