Ally
Ally

Reputation: 4942

Setting up a local.host alias for localhost on windows

I'm trying to setup everyauth for my node app. Although I've reached a step that I have no idea how to accomplish.

It's asking to setup local.host as an alias for localhost, but it references some linux folders, I'm using windows.

Here's the exact instructions I'm stumped on.

Important - Some OAuth Providers do not allow callbacks to localhost, so you will need to create a localhost alias called local.host. Make sure you set up your /etc/hosts so that 127.0.0.1 is also associated with 'local.host'. So inside your /etc/hosts file, one of the lines will look like: '127.0.0.1 localhost local.host'

(source here)

How do you accomplish this on windows?

Upvotes: 2

Views: 11176

Answers (2)

Rich Carlson
Rich Carlson

Reputation: 11

Regarding the answer (Add the entry to your HOSTS file)

This does not work entirely on Windows 10, Windows Server 2019. You CAN PING the new alias (ping local.host), but it you try to use it in windows explorer (\local.host), you get a login prompt that will always fail. Check the EVENT viewer and you will see:

Audit Failure ... A privileged service was called. . . . C:\Windows\SystemApps\Microsoft.Windows.Cortana_cw5n1h2txyewy\SearchUI.exe Service Request Information: Privileges: SeTcbPrivilege

I've found no way around this.

So the answer is technically correct, but may not work in all cases.

Upvotes: 1

Vinz243
Vinz243

Reputation: 9938

This can be done by editing you hosts file. Open notepad++ (or notepad) as admin. Then hit open, and select C:\Windows\System32\drivers\etc\hosts. You will see:

# Copyright (c) 1993-2006 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# ...
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
#      102.54.94.97     rhino.acme.com          # source server
#       38.25.63.10     x.acme.com              # x client host

127.0.0.1       localhost
::1             localhost

And add this line at the end:

127.0.0.1       local.host

Save and you're done

Upvotes: 9

Related Questions