Hi,
I'd like to make some changes to the Hosts file. I know how to do it in Terminal but I'd like to have a backup of the current Hosts file in case things go awry.
Could you please guide me on how to do that?
Thank you.
In Terminal type in then hit enter key.
Code:
sudo cp /etc/hosts /etc/hosts.backup
You will need to type in your password. Alternatively you can just make your changes in the existing file just adding a comment to know what you did, an original /etc/hosts files content.
Code:
##
# 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
fe80::1%lo0 localhost
Changed.
Code:
##
# 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
fe80::1%lo0 localhost
# Added by me to have this IP address resolve to my example domain.
192.168.0.100 example.domain.com
Anything that has a # character in front of it on a line is considered a comment and is ignored by the system. This is an easy way on a Unix system to document your changes in configuration files to remind yourself in the future why you did it and what was changed. You can just duplicate an existing line commenting one out for instance to make a change still keeping the original intact.