Skip to Main Content
Mac OS X for Unix Geeks
book

Mac OS X for Unix Geeks

by Ernest E. Rothman, Brian Jepson
September 2002
Beginner to intermediate content levelBeginner to intermediate
216 pages
7h 43m
English
O'Reilly Media, Inc.
Content preview from Mac OS X for Unix Geeks

Creating a Host with niload

If you are using Mac OS X 10.1.5 (or an earlier version of Mac OS X), you’ll need to use NetInfo to maintain the hosts database. 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 uses a here document instead of a separate file to add the host xyzzy:

# niload hosts . <<EOF
? 192.168.0.1 xyzzy
? EOF

If you add an entry that already exists, it will not be changed or overwritten. Instead, niload will silently ignore your command. (To override this behavior, see the -m option under “niload” in Section 3.6, earlier in this chapter.)

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Mac OS X For Unix Geeks, 4th Edition

Mac OS X For Unix Geeks, 4th Edition

Ernest E. Rothman, Rich Rosen, Brian Jepson
Mac OS X Hacks

Mac OS X Hacks

Kevin Hemenway, Rael Dornfest
Mac OS X in a Nutshell

Mac OS X in a Nutshell

Jason McIntosh, Chuck Toporek, Chris Stone

Publisher Resources

ISBN: 0596003560Errata Page