Basic knowledge and configuration of Linux system network

Source: Internet
Author: User
Tags rfc

One: Introduction to DNS (Domain Name System)

DNS (domain Name System), a distributed database of domain names and IP addresses that are mapped to each other on the Internet, makes it easier for users to access the Internet without remembering the number of IP strings that can be read directly by the machine. The process of obtaining the IP address of the host name through the hostname is called Domain name resolution (or hostname resolution). The DNS protocol runs on top of the UDP protocol, using the port number 53. RFC 2181 has a canonical description of DNS in RFC 2136, a description of dynamic updates to DNS, and RFC 2308 describes the reverse caching of DNS queries.

Such as: User access to the basic process of the site: first find the local Hosts file, DNS cache, if not, continue to find Ldns, through a number of column steps to find the domain name corresponding IP address, and then through the IP address, access to the website data.

Second: Modify the host step

Temporary method:

Hostname name, then exit the current shell and log in again to take effect. This method temporarily changes and fails after rebooting the system.

Permanent method:

Step 1:

Vi/etc/sysconfig/network

Networking=yes

Hostname=xiaoxiao

Tip: After this change, the execution of/etc/init.d/network restart or source/etc/sysconfig/network does not take effect, you may need to restart the server.

Step 2:

Then through the command modification: hostname Xiaoxiao, after the completion of the logout system will take effect. This guarantees the temporary entry into force and, after the restart, also takes effect. /etc/hosts inside the corresponding hostname also to change the

Law II: Perform setup-network configuration-edit DNS configuration--dns Config

Special Note: The above methods are likely to cause the corresponding hostname in/etc/hosts unmodified, at this time, you should manually modify the Vim/etc/hosts

If/etc/hosts does not change, will encounter some problems later, such as SendMail start slowly, IDAP service parsing is slow, sudo switch user slow and so on is the hostname and/etc/hosts resolution is not caused.

Three NIC configuration file

Type=ethernet #网络类型
Bootproto=none
Defroute=yes
Ipv4_failure_fatal=no
Ipv6init=yes
Ipv6_autoconf=yes
Ipv6_defroute=yes
Ipv6_failure_fatal=no
Name=em1 #网卡名字
uuid=bc419868-5bke-4502-8732-7f7fb01dd569
Device=em1 #设备名
Onboot=yes #开机网卡自启动
ipaddr=10.0.0.10 #ip地址
Prefix=24 #子网掩码24位, which is equivalent to 255.255.255.0
gateway=8.8.8.8 #网关
Ipv6_peerdns=yes
Ipv6_peerroutes=yes

Three configuration Modify IP address

1) Setup network configuration, then modify

2) directly modify the configuration file Vi/etc/sysconfig/network-scripts/ifcfg-em1, and then restart the NIC/etc/init.d/network restart

Configure aliases for Nic: Ifconfig em1:0 10.21.63.155/24 up de-alias Ifconfig em1:0 down

Quad Configuration Gateway

First entry into force document/ETC/SYSCONFIG/NETWORK-SCRIPTS/IFCFG-EM1

Second entry into force document/etc/sysconfig/network

Law III: Modify the default gateway by command

Route del default GW 8.8.8.8 #删除默认网关

Route del default GW 8.8.8.8 #添加默认网关

Note: This method is temporarily modified, after reloading or starting the network card will be invalidated, the solution is to try to configure in the configuration file.

Five view IP, gateway or route, DNS configuration:

1 Ifconfig #显示所有网卡

2 ifconfig em1# Display the specified NIC Em1

3 Route-n #查看路由

4 Cat/etc/sysconfig/network-scripts/ifcfg-em1 #查看DNS

Six View network status

1 ifconfing

2 Route-n

3 netstat

Seven Network checks:

1 Ping www.baidu.com #icmp协议基础, see not through

2 traceroute www.baidu.com #基础检查, see if it hurts

3 Telnet 10.0.0.24 80 Check that the server Web is open, the service is not open, and the fire wall is blocked

Eight Grab Bag tool

Tcpdump

Tcpdump-n Icmp-i em1

Nine DNS domain name resolution query

1 Dig www.baidu.com

2 nslookup

3 Host

10 LAN machine is unable to correct the Internet

1 is the physical link unblocked?

2 native IP, routing, DNS settings compliance

3 Test the unblocked condition to the gateway or route.

4 Test ping public IP condition

5 Testing the unblocked DNS

Based on the results of each level, if you are a system administrator, you can also troubleshoot the gateway router.

Basic knowledge and configuration of Linux system network

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.