Modify the host file under Ubuntu

Source: Internet
Author: User

Original address: http://www.cnblogs.com/kingcat/archive/2012/02/23/2364509.html

Sometimes, we need to let some domain name point to the local, to implement debugging, the following is introduced under Ubuntu modified host to implement the domain name to local method.
Ubuntu system's hosts only need to modify the/etc/hosts file, in the directory there is also a hosts.conf file, just at the beginning thought that only needs to modify this can be, the results found that the need to modify the hosts. Restart the network when you are finished modifying it.

Open the Host file

Vim gedit/etc/hosts

Add the items you want, in the following format:

Format:
<IP> <HOSTNAME>.<DOMAIN> <ALIAS>

Example:

216.239.37.99 www.google.com

After editing, you need to restart your network.

/etc/init.d/networking restart

Modify the host file under Ubuntu

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.