DirectNET

Data Center Management Solutions including UPS Systems, Data Center Cooling, KVM over IP & IP Power Strips, Server Racks and Server Rack accessories; KVM Switches and KVM Extenders; Rackmount Monitors and Rackmount Keyboards.


NAVIGATION
Home
Store
INSIDE MAC
Television Shows
Broadcast Shows
Daily News Shows
Special Shows
EVENTS
DAILY TIPS
Design
Mac OS X
Mac OS X UNIX
COMMUNITY
Forums
Surveys
NEWS
Current
Press
Archive
FEATURES
Editorial
Dr. Mac
Reviews
Reader Reports
RESOURCES
FAQ
Documentation
Learning Center
MAN pages
Glossary
Tutorials
Tips
Links

OUR PARTNERS

OSXFAQ Mac OS X UNIX Tip-of-the-Day   back to index

Week 103 - Unix Commands Reference III (28 March 2005)

by Adrian Mayo - Editor, OSXFAQ

Friday - Commands for Network Information

hostname ... set or display the hostname
Option -s to display hostname without domain name part.
hostname is normally set automatically from /etc/hostconfig

ifconfig ... configure network interfaces
Without any parameters displays the configuration for all network interfaces
For example, 'ifconfig en0 down' then 'ifconfig en0 up' resets en0.

ipconfig ...set the IP mode of an interface
Usage is:
ipconfig set <interface> BOOTP|MANUAL|DCHP|NONE|INFORM

route ... maintain network routing tables
The routine information for a destination can be queried with:
route -v get apple.com
route -v get localhost

arp ... maintain address resolution protocol tables
The tables map IP addresses to Ethernet addresses
Option -a to display all table entries

service ... start and stop xinetd services
option --list to list the services
The possible commands are 'start' and 'stop'.

netstat ... display the network status
Shows the state of all network connections (sockets)
Option -I to specify a particular interface like en0

tcpdump ... dump tcp activity
Option -v, -vv, -vvv to increase verbosity of reports
For example, to listen to network traffic with apple.com use 'sudo tcpdump -vvv host apple.com'

tcpflow ... dump and analyse tcp activity
Like tcpdump but not included with OS X. Available from ports such as Fink.

nslookup ... interactive domain name query (DNS)

dig ... look up DNS information
Works both as a one-off command or interactively.

host ... look up DNS information
Option -t to specify the type of DNS record to look up.
For example 'host -t ns apple.com' to fetch name server records for apple.com. 't can also be 'mx', 'a', 'soa', etc.
Option -a to request all DNS information for the host

(See tips week 43)

named ... DNS daemon
This runs a DNS service

ntpd ... network time protocol daemon
This runs an ntp server

ntpq ... query ntp time server

ntptimeset ... set network time


Discuss this trick in the Learning Center forum


If you want to learn more about Mac OS X Unix visit the Learning Center  click.

  • For beginners: Mac OS X Unix Tutorials
  • For detailed information on specific topics: Advanced Unix
  • For OS X in gereral: Mac OS X Tutorials

Copyright © 2000-2008 Inside Mac Media, Inc. All rights reserved.
Apple assumes no responsibility with regard to the selection, performance, or use of the products or services. All understandings, agreements, or warranties, if any, take place directly between the vendors and prospective users.
Apple, the Apple logo, Mac, PowerMac G4, PowerMac G5, Xserve, Xserve RAID, PowerBook, iBook, Airport, AirPort Extreme, iMac, eMac, iLife, iMovie, iCal, iPhoto, iTunes, QuickTime, FireWire, iPod, iSight, AppleWorks, Macintosh, Jaguar, Panther, Mac OS, Mac OS X and Mac OS X Server are trademarks of Apple Computer, Inc.