Manually set the host dns ip address in Linux

Source: Internet
Author: User


1. manually set the Host. Add the information vim/etc/hosts at/etc/hostname and insert a line at the end of/etc/hosts. Example: 219.232.244.185 fengbin. me format: IP address domain name Step 2 Modify/etc/sysconfig/networkvim/etc/sysconfig/network if networking = yes if not equal to yes then change to yeshostname = fengbin. me2, modify IP www.2cto.com 1. The most common command for configuring ip addresses for NICS is # ifconfig eth0 192.168.0.1 netmask 255.255.255.0 up. Description: eth0 is the first Nic, And the other commands are eth1, eth * 192.168.0.1 is the IP address configured for the first Nic for the NIC. netmask 255.255.255.255.0 is configured with the subnet mask up. It indicates that ifconfig is activated immediately. For more parameter descriptions, see related help. 2. manually modify/ etc/sysconfig/network-scripts/ifcfg-eth0 file vi open ifcfg-eth0 file original content: DEVICE = eth0BOOTPROTO = Cost = 00: 03: 47: 2C: D5: 40 ONBOOT = yesTYPE = change Ethernet to: DEVICE = eth0BOOTPROTO = staticIPADDR = temperature = 255.255.255.0GATEWAY = 192.168.1.1HWADDR = 00: 03: 47: 2C: D5: 40 ONBOOT = yes www.2cto.com TYPE = Ethernet run the command/sbin/ifdown eth0/sbin/ifup eth0/etc/init respectively. d/network restart // set the gateway to take effect immediately ifup-indicates the dialing connection command, if the command can be successfully executed on the command line or terminal, ifdown indicates that the connection is disconnected, similarly, this command can be successfully executed on the command line or terminal. 3. Modify DNS to modify/etc/resolv. confnameserver 202.102.24.35 specifies the address of the dns server author haige18

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.