How to edit the Hosts file on Mac

My name is Ito and I am an infrastructure engineer.
How to edit the Hosts file on a Mac
# sudo vi /private/etc/hosts
Here is the default hosts file:
## # Host Database # # localhost is used to configure the loopback interface # when the system is booting. Do not change this entry. ## 127.0.0.1 localhost 255.255.255.255 broadcasthost ::1 localhost
Add it at the bottom in the same format
127.0.0.1 test.org
I'll check it out
MacBook-Air:~ ito$ ping test.org PING test.org (127.0.0.1): 56 data bytes 64 bytes from 127.0.0.1: icmp_seq=0 ttl=64 time=0.070 ms 64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.193 ms
It's set up properly!
If you found this article helpful , please give it a like!
0