I struggled with this same thing. It's kind of tricky, and consensus seems to be that you should either set up two Twitter apps (one for local use and one for public use) or just be prepared to change your Twitter app's "callback URL" when your node app goes live.
In my case, I didn't need to modify my hosts file, but rather I changed the "callback URL" in my Twitter app to the following:
http://127.0.0.1:3000/auth/twitter/callback
If you're using the default everyauth callback configuration, it's automatically set to accept callbacks at /auth/twitter/callback
. No matter what is in your hosts file, it should resolve to 127.0.0.1
regardless, so you're always safe with that URL configuration when working locally.
EDIT:
One other thing you might want to try in addition is replacing this call
local.host:3000/auth/twitter
with this
127.0.0.1:3000/auth/twitter
I only suggest this because if you erroneously modified something in your hosts file, that could be causing a conflict as well. If you simply added lines to your hosts file, rather than modifying what was already there, you can also try replacing this
127.0.0.1 localhost local.host
with this
127.0.0.1 local.host
..as the first one looks malformed to me (two aliases instead of one).