Reputation: 1696
I am trying to add new entry to the /etc/hosts in mac os (el Capitan) how ever when I try to ping this entry , I am getting error of not resolved there is no nsswitch file what am I missing?
##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting. Do not change this entry.
##
local.datafabric.io localhost
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
Upvotes: 0
Views: 55
Reputation: 714
In the man page for the hosts file
man hosts
the syntax is explained:
IP_address canonical_hostname [aliases...]
so, if you want to add the name local.datafabric.io
as an alias for localhost (127.0.0.1), the line should look like this:
127.0.0.1 localhost local.datafabric.io
man
is your friend.
You will probably also want to flush your dnscache. The correct commands for that are depending on the actual version of MacOS.
Upvotes: 1