November 2005
Beginner to intermediate
528 pages
24h 11m
English
The niload utility understands the flat file format used by /etc/hosts (ip_address name). See the hosts(5) manpage for a description of each field. To add a new host, create a file using that format and load it with niload. This example ads the host xyzzy:
$sudo niload hosts . <<EOF>192.168.0.1 xyzzy>EOF
If you add an entry that already exists, it will be overwritten.
The /etc/hosts file takes precedence over the local directory, so if you enter the same hostname with different IP addresses in both places, Mac OS X uses the one in /etc/hosts.
Read now
Unlock full access