Automatically update ip-address in hosts file?

1

My development environment is Ubuntu guest OS inside VMWare Player with Windows 7 as the host OS. I edit the hosts file in windows to point http://dev.mydomain.com to the ip-address of my VM so that I can test browsers in windows. I love this setup, but have to update my hosts file quite often to take advantage of it. Is there a way to either prevent the ip-address from changing so frequently, or to automatically update the hosts file when it changes?

Anson Kao

Posted 2011-07-10T19:07:12.207

Reputation: 113

3Is your Virtual networking setup NAT or bridged? Any reason why you can't just set a static IP in Ubuntu? – growse – 2011-07-10T19:20:49.133

That's exactly what I'm asking how to do! – Anson Kao – 2011-07-10T23:04:43.540

Answers

2

It may be simpler to set your virtual machines networking to Bridged and set a static IP up in Ubuntu.

dannymcc

Posted 2011-07-10T19:07:12.207

Reputation: 310

Awesome, can you point me in the right direction on how to do that? I tried changing VMWare player to bridged, after which my hosts don't seem to work anymore – Anson Kao – 2011-07-11T00:39:12.287

Nevermind, I probably just didn't wait long enough for the settings to kick in. Thanks! – Anson Kao – 2011-07-11T03:22:53.337