3

I would like to set an alias on my local PC for a network machine. I know that it can be done by adding an entry in the hosts file as long as the IP address of the machine is also specified. However, the problem is that IPs are dynamically assigned by a DHCP server so I don't know for sure the IP address. Is there a way to define just an alias based on the machine's network name?

P.S.: I'm running Windows Server 2008 R2.

3 Answers 3

4

Windows only supports IP to Hostname mapping. You cannot set up local aliases using the hosts file.

If you have control over the DNS for the network, you can create a CNAME record that maps one name to another name.

If you do not have control over the network's DNS - you are out of clean options (barring a frankensteined DNS server running on your localhost just for the creation of your own CNAMEs. shudders)

1
  • Ok, so my options are as limited as I thought. Thanks for the confirmation.
    – Alex G.
    Apr 9, 2012 at 19:56
1

On networks where WINS is enabled/configured, one can refer to another machine by using the network name wherever a hostname is taken, and the OS libraries will map it to the IP address appropriately.

1
  • Unfortunately WINS is not enabled so I cannot use that but thanks for the suggestion.
    – Alex G.
    Apr 9, 2012 at 19:56
-1

This "kinda" works (it depends on your version of windows ) in HOSTS (C:\Windows\System32\drivers\etc\hosts)

Specify:

127.0.0.1 testb

In regedit, create a DWORD as follows: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa New DWORD DisableLoopbackCheck Set to 1

PING works on both Windows Server 2012 and 2019. Specifying the new alias in an explorer window (or opening it with a program) works fine in Windows Server 2012, but fails on Windows 2019 (it gets into credentialing loop and does not accept valid credentials)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .