Tcp&Dns working mechanism under Linux

  
                              




Linux is a true multiplex operating system that is robust enough to be used in universities and even large corporations. Linux can operate on the low-end 386 platform, and even the huge ultra-parallel machines in the research center have his tracks. He is beyond the realm of the platform, Intel, Sun Sparc, Dec Alpha, M68000, MIPS, PowerPC and other architectures are available, and the experimental version can be embedded in other operating systems (SGI) , Ultra Sparc, ...), its excellent performance has been greatly developed in the field of embedded system applications.

Linux's network performance is excellent, not only because the network and Linux operating system are tightly integrated, but also too many applications are freely available. It enables a cheap PC to act as a server and achieves high service performance.

Configuration of TCP/IP network under Linux:

A general Linux TCP/IP network can be configured by using the netconf command, but some systems do not provide this command, so we need to manually configure it. First of all, your compiled kernel needs network support and provides the following network information: hostname (hostname), domain name (domain name), IP address, network mask, network address, broadcast address ( Broadcast address ), gateway address, name server address, etc. For example, the information and network configuration process of my machine:


Host name Guhang
Domain name Guhang.linux.com
IP address 159.226.4.210
Subnet mask 255.255.255.192
Network address 159.226.4.0
Broadcast address 159.226.4.255
Gateway address 159.226.4.254
Domain name server address 159.226.5.65 (can specify up to three sequential search addresses)

Settings Host name: The command hostname (refer to man hostname) can be modified and set the host name. It can also be done by modifying the related configuration file
/etc/HOSTNAME.
#hostname Guhang //or #echo “Guhang” >/etc/HOSTNAME
? Start network device: ifconfig (refer to man ifconfig) command can bind an IP address to a network hardware device.
#ifconfig lo 127.0.0.1 //Specify the local loopback interface lo and its IP address
#ifconfig eth0 159.226.4.200 broadcast 159.226.4.255 netmask 159.226.4.192
//Bind the IP address of the interface device eth0
Add routing list: route (refer to man route) command to add a routing list to an interface device.
#route add –net 127.0.0.0 //Add the network address of the loopback interface device to the kernel routing table
#route add –net 159.226.4.0 netmask 159.226.4.255
#route add default gw 159.226 .4.254 eth0 //Add default gateway for interface eth0
Additional settings: /etc/hosts (record hostname and address mapping table), /etc/host.conf (domain name search order), /etc/resolv.conf< BR> (Specified domain name and domain name server)
#echo "127.0.0.1 localhost" >/etc/hosts
#echo "159.226.4.210 Guhang.linux.com Guhang" >>/etc/hosts
#echo “order host, bind” >/etc/host.conf
#echo “nameserver 159.226.5.65” >/etc/resovl.conf

DNS Domain Name System:

The most basic service in TCP/IP network services is the naming service, which is used to translate host names and IP addresses. For example, you can
: telnet Guhang.linux.com (hostname)
Also: telnet 159.226.4.210 (IP address)
The result of these two commands is the same, all connected to IP The host with the address of 159.226.4.210 is convenient for the computer to refer to the host by IP address, but it is more convenient for the user to use the name, which is easier to remember, which requires a conversion table. IP address translation
is the host name. For a small LAN host, there will not be a lot of data in the conversion table, but since there are millions of hosts on the Internet, and there are still many computers joining every day, if everyone keeps the latest conversions The table is impossible, so DNS appears.

DNS is the Domain Name System, a rule for naming machines and a soft
that translates these names into IP numbers, through which each site only needs to maintain its own IP address. Mapping to hostnames. Each site puts this mapping into a publicly queried database, so anyone who wants to find the IP address of the corresponding hostname in the site simply queries the database for that site. In order to access this database, you need to run a DNS server at that site. DNS servers are divided into three categories:
◆ Primary DNS server (master/primary)
◆ From DNS server (slave/secondary)
◆ Buffer DNS server (caching)
DNS is distributed , hierarchical database. The current DNS database has millions of records distributed across dozens of thousands of servers, which can reduce the task of maintaining a database.



Copyright © Windows knowledge All Rights Reserved