Common MAC system commands

Source: Internet
Author: User

ZZ: http://blog.csdn.net/ilittlesheep/article/details/7539192

 

Common scutil -- set (SUDO), networksetup (SUDO), NSLookup

 

1. List all Network Services
$ Sudo networksetup-listallnetworkservices
An asterisk (*) denotes that a network services is disabled
Bluetooth dun
Ethernet
Firewire
Wi-Fi
Bluetooth pan

2. Get Ethernet info
$ Sudo networksetup-getinfo Ethernet

3. Find machine DNS name
$ NSLookup 172.1610.30

4. Set machine Host Name
$ Scutil-set hostname "Your host name"
Set machine local host name
$ Scutil-set localhostname "your local host name"
Set machine computer name
$ Scutil-set computername "your computer name"
Differences between the three names:
A computer name is equivalent to an alias instance. You can enter special characters to ignore its existence.
Host name used in the network. If a conflict occurs in the network, it may be automatically modified by DNS (to be confirmed)
The local host name is similar to the host name. Generally, it is okay to keep the two files in a uniform state. No more experiments are performed and will be updated.

Example:
The company's development environment depends on hostname. Otherwise, an error is returned because the hostname cannot be read and the local configuration cannot be read during. Configure.
Solution:
1. Reset the hostname:
Scutil -- set hostname ygao. *****. com

2. Set the hostname and the local Ping fails. You need to add
127.0.0.1 localhost ygao. *****. com

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.