Modify the IP address or DNS of Debian

Source: Internet
Author: User

In Debian, the IP address configuration parameters are in the interface under the/etc/Network/directory, while the DNS configuration parameters are in the resolv. in Conf, the following describes the configuration parameters:

======================================

IP Address Settings:/etc/Network/interface

// Obtain Dynamic DHCP

# Start the system activation device
# Loop address
Auto Lo
Iface lo Inet loopback

# Start the system activation device
# Set eth0 to DHCP
Auto eth0
Iface eth0 Inet DHCP

// Obtain the static data

# Start the system activation device
# Loop address
Auto Lo
Iface lo Inet loopback

# Start the system activation device
# Set the network adapter eth0 to the static type
Auto eth0
Iface eth0 Inet static

# Specifying IP addresses, subnet masks, and gateways
Address 192.168.0.1
Netmask 255.255.255.0
Gateway 192.168.0.1

Note: When configuring IP address parameters, "// dynamic DHCP get" and "// static get" can only be one of them. The two cannot exist at the same time. Remember !!!

======================================

DNS Server Settings:/etc/resolv. conf
# It must be set. Otherwise, no URL can be accessed.

Nameserver 202.103.0.117

Nameserver 211.95.193.97

======================================

Restart Nic

/Etc/init. d/networking restart
Ifdown eth0
IFUP eth0

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.