Solved

Accessing a computer by name in hosts instead of IP?

Posted on 2006-11-15
5
167 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

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

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

As Wikipedia explains 'robots.txt' as -- the robot exclusion standard, also known as the Robots Exclusion Protocol or robots.txt protocol, is a convention to prevent cooperating web spiders and other web robots from accessing all or part of a websit…
If you've heard about htaccess and it sounds like it does what you want, but you're not sure how it works... well, you're in the right place. Read on. Some Basics #1. It's a file and its filename is .htaccess (yes, with a dot in the front). #…
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

896 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now