Solved

Accessing a computer by name in hosts instead of IP?

Posted on 2006-11-15
5
185 Views
Last Modified: 2010-03-04
Hi There,

I've got a confusing situation but I think it boils down to basic theory, heres the situation first:

I'm developing local websites on my Mac and running Parallels (virtualization software), in it I am running Windows XP, in Windows XP I want to access my Mac's local websites.

I can do this by editing the hosts file on the WinXP machine and telling it to look for dummy.website.test at my Mac's IP address and it works a treat. However the Mac's IP address always changes...

Can you think of some way that will make it work without me having to edit the hosts file every time I change networks?

Thanks,
Ant
0
Comment
Question by:antum
  • 3
  • 2
5 Comments
 
LVL 57

Expert Comment

by:giltjr
ID: 17953218
Is this your home or work network?  

Is this using private or public IP addressing?
0
 
LVL 13

Expert Comment

by:rhickmott
ID: 17956999
yes use http://127.0.0.1/

This is your loopback address and will always show the local content on that machine regardless of what IP addresses it has and you wont even need to edit the hosts file for it.
0
 
LVL 13

Expert Comment

by:rhickmott
ID: 17957012
or in the hosts file point

dummy.website.test  at 127.0.0.1 ( you will see there is also an entry for "localhost" pointing at the same IP )

You can also use http://localhost/ works the same :)
0
 
LVL 57

Expert Comment

by:giltjr
ID: 17957971
Nope, that won't work guys.  The websever is on one computer (the MAC) and he wants to get to it from another computer (Windows).

If he puts 127.0.0.1 on the Windows box it will try and get to the Windows box, not the MAC.
0
 
LVL 13

Accepted Solution

by:
rhickmott earned 500 total points
ID: 17957996
Oh sorry I misread the question.

There is going to be no easy way of doing this other than assigning the MAC a static IP Address if your own your network system then this is easy as you can add an entry in the DHCP table of your router or simply assign it one under the network properties and enter your routers gateway address.
0

Featured Post

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

If you are running a LAMP infrastructure, this little code snippet is very helpful if you are serving lots of HTML, JavaScript and CSS-related information. The mod_deflate module, which is part of the Apache 2.2 application, provides the DEFLATE…
It is possible to boost certain documents at query time in Solr. Query time boosting can be a powerful resource for finding the most relevant and "best" content. Of course the more information you index, the more fields you will be able to use for y…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

740 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question