Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Accessing a computer by name in hosts instead of IP?

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

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…
Over the last year I have answered a couple of basic URL rewriting questions several times so I thought I might as well have a stab at: explaining the basics, providing a few useful links and consolidating some of the most common queries into a sing…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

861 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