Network configuration under UbuntuServer

Source: Internet
Author: User
Tags nslookup command
UbuntuServer network configuration check network configuration www.2cto.com $ ifconfig configure DHCP client $ sudovi/etc/network/interfaces add ifaceeth0inetdhcp configure static IP address $ sudovi/etc/network/interfaceset...
Check the network configuration in Ubuntu Server by configuring www.2cto.com $ ifconfig to configure the DHCP client $ sudo vi/etc/network/interfaces add iface eth0 inet dhcp to configure the static IP address $ sudo vi/etc/network/ the configuration of interfaceseth0 is as follows: www.2cto.com auto eth0address 192.168.0.88netmask 255.255.255.0gateway 192.168.0.1 after the new configuration takes effect and is saved and exited, restart the networking command to make the new configuration take effect: $ sudo/etc/init. d/networking restart can also restart the NIC for the new configuration to take effect. the advantage is that it does not affect other network interfaces: $ sudo ifdown eth0 $ sudo ifup eth0 temporarily changes the IP address $ sudo ifco Nfig eth0 192.168.1.111 netmask 255.255.255.0 after the system restarts, the configuration in interfaces will be restored. There are two ways to set the default gateway: 1. set it in the interfaces file. $ Sudo vi/etc/network/interfaces add gateway under eth0 configuration, such as: auto eth0iface eth0 inet staticaddress 192.168.1.123netmask 255.255.255.0gateway 192.168.1.12. directly use the command to set: delete the current default gateway $ sudo route del default gw manually configure the default gateway $ sudo route add default gw 192.168.1.1 View route information $ route use this method, the modification takes effect immediately, after restarting, the settings in the interfaces file are valid. View the host name $ hosts temporary modification host name $ sudo hostname testserver takes effect immediately after the command is executed. Permanently change the host name $ sudo vi/etc/hostname to write the new host name. When the system restarts, the host name in the file is read. Configure the DNS server address. a maximum of three DNS servers can be used: $ sudo vi/etc/resolv. confnameserver 202. xx. xx. xxnameserver 192.168.1.1 pair "resolv. conf "changes take effect immediately. You can use the nslookup command to query the DNS server to verify the "resolv. conf" configuration file.
 
Related Article

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.