Solved

Accessing a computer by name in hosts instead of IP?

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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

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 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…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

758 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

17 Experts available now in Live!

Get 1:1 Help Now