How can I add 127.0.0.1 localhost to my etc/hosts file/

Joined
Oct 14, 2007
Messages
408
Reaction score
0
Points
16
So, for months and months, my computer, every 12 seconds or so in the console, shows this: rpc.lockd: can't contact statd, 100024 RPC: Unknown host

I want to resolve this. It cant be good.

Someone on the Apple Disccussion proposed this as a solution: "sounds kinda like loop back is missing from your etc/hosts file? Add 127.0.0.1 localhost if its not at the head of the file and see if it fixes the problem."

I want to try that but I have no idea how to. Can someone explain this to me?
 
OP
O
Joined
Oct 14, 2007
Messages
408
Reaction score
0
Points
16
I tried the first part of what he said and i got this message: "-bash: $: command not found"
 

vansmith

Senior Member
Joined
Oct 19, 2008
Messages
19,924
Reaction score
559
Points
113
Location
Queensland
Your Mac's Specs
Mini (2014, 2018, 2020), MBA (2020), iPad Pro (2018), iPhone 13 Pro Max, Watch (S6)
Do this instead:
Code:
less /private/etc/hosts
Copy here what gets shown on the screen. When you're done push q to close less.
 

vansmith

Senior Member
Joined
Oct 19, 2008
Messages
19,924
Reaction score
559
Points
113
Location
Queensland
Your Mac's Specs
Mini (2014, 2018, 2020), MBA (2020), iPad Pro (2018), iPhone 13 Pro Max, Watch (S6)
In that case, it is quite clear that indeed, you don't have the loopback. Do the following:

1. Type the following and press enter:
Code:
sudo nano /private/etc/hosts
2. Enter your password (you won't see it but it is indeed being registered).
3. Paste the following:
Code:
127.0.0.1       localhost
4. Press Control + O, press enter to save it and then press Control + X to quit
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top