Linux TCP/IP Network configuration files
File Description /etc/resolve.conf List DNS servers for internet domain name resolution.
Manual page for: /etc/resolv.conf/etc/hosts Lists hosts to be resolved locally (not by DNS).
Manual page for: /etc/hosts/etc/nsswitch.conf List order of host name search. Typically look at local files, then NIS server, then DNSserver.
Manual page for: /etc/nsswitch.confRed Hat/Fedora/CentOS: /etc/sysconfig/network Specify network configuration. eg. Static IP, DHCP, NIS, etc. Red Hat/Fedora/CentOS: /etc/sysconfig/network-scripts/ifcfg-device Specify TCP network information. Ubuntu/Debian: /etc/network/interfaces Specify network configuration and devices. eg. Static IP and info, DHCP, etc.
- DOMAIN RESOLUTION CONFIGURATION FILES
- File: /etc/resolv.conf - host name resolver configuration file
search name-of-domain.com - Name of your domain or ISP's domain if using their name server nameserver XXX.XXX.XXX.XXX - IP address of primary name server nameserver XXX.XXX.XXX.XXX - IP address of secondary name server
Red Hat/Fedora GUI: /usr/sbin/system-config-network (select tab "DNS"). - File: /etc/hosts - locally resolve node names to IP addresses
127.0.0.1 your-node-name.your-domain.com localhost.localdomain localhost XXX.XXX.XXX.XXX node-name
XXX.XXX.XXX.XXX superserver.yolinux.com superserver
This informs Linux of local systems on the network which are not handled by the DNS server. (or for all systems in your LAN if you are not using DNS or NIS)The file format for the hosts file is specified by RFC 952.
Red Hat/Fedora configuration GUI: /usr/sbin/system-config-network (select tab "Hosts").
- File: /etc/nsswitch.conf - System Databases and Name Service Switch configuration file
hosts: files dns nisplus nis
Assigning IP addresses
Computers may be assigned a static IP address or assigned one dynamically. Typically a server will require a static IP while a workstation will use DHCP (dynamic IP assignment). The Linux server requires a static IP so that those who wish to use its resources can find the system. It is more easily found if the IP address does not change and is static. This is not important for the Linux client workstation and thus it is easier to use an automated Dynamic Host Configuration Protocol (DHCP) for IP address assignment.
Static IP address assignment:
Choose one of the following methods:
- Command Line:
/sbin/ifconfig eth0 192.168.10.12 netmask 255.255.255.0 broadcast 192.168.10.255
Network address by convention would be the lowest: 192.168.10.0
Broadcast address by convention would be the highest: 192.168.10.255
The gateway can be anything, but following convention: 192.168.10.1Note: the highest and lowest addresses are based on the netmask. The previous example is based on a netmask of 255.255.255.0
- Red Hat / Fedora GUI tools:
- /usr/bin/neat Gnome GUI network administration tool. Handles all interfaces. Configure for Static IP or DHCP client.
(First available with Red Hat 7.2.) - /usr/bin/netcfg (Handles all interfaces) (last available in Red Hat 7.1)
- /usr/bin/neat Gnome GUI network administration tool. Handles all interfaces. Configure for Static IP or DHCP client.
- Red Hat / Fedora Console tools:
- /usr/sbin/system-config-network-tui (Text User Interface)
- /usr/sbin/netconfig (Only seems to work for the first network interface eth0 but not eth1,...)
- Directly edit configuration files/scripts. See format below.
The ifconfig command does NOT store this information permanently. Upon reboot this information is lost. Manually add the network configuration to /etc/sysconfig/network-scripts/ifcfg-eth0 (Red Hat/Fedora/CentOS) for the first NIC, ifcfg-eth1 for the second, etc, or /etc/network/interfaces (Ubuntu) as shown below. Any other commands you may want to add to the system boot sequence can be added to the end of the file /etc/rc.d/rc.local. The commands netcfg and netconfig make permanent changes to system network configuration files located in /etc/sysconfig/network-scripts/, so that this information is retained and used upon system boot.
Static and Dynamic IP Configuration
Static IP address configuration:
DEVICE=eth0 BOOTPROTO=static BROADCAST=XXX.XXX.XXX.255 IPADDR=XXX.XXX.XXX.XXX NETMASK=255.255.255.0 NETWORK=XXX.XXX.XXX.0 ONBOOT=yes - Will activate upon system boot
- TYPE=Ethernet
- HWADDR=XX:XX:XX:XX:XX:XX
- GATEWAY=XXX.XXX.XXX.XXX
OR for DHCP client configuration:
DEVICE=eth0 ONBOOT=yes BOOTPROTO=dhcp
- One may also want to check the file /etc/hosts for an entry using the system name which allows the system to be self aware.The hostname may be changed at runtime using the command: sysctl -w kernel.hostname="superserver"
Source: http://www.yolinux.com/
ReplyDeleteQ: - What is round robin DNS?
ReplyDeleteRound robin DNS is usually used for balancing the load of geographically distributed Web servers. For example, a company has one domain name and three identical home pages residing on three servers with three different IP addresses. When one user accesses the home page it will be sent to the first IP address. The second user who accesses the home page will be sent to the next IP address, and the third user will be sent to the third IP address. In each case, once the IP address is given out, it goes to the end of the list. The fourth user, therefore, will be sent to the first IP address, and so forth.
Q: - What is Name Server?
A name server keeps information for the translation of domain names to IP addresses and IP addresses to domain names. The name server is a program that performs the translation at the request of a resolver or another name server.
Q: - What is Primary name server or primary master server?
Primary name server/primary master is the main data source for the zone. It is the authoritative server for the zone. This server acquires data about its zone from databases saved on a local disk. The primary server must be published as an authoritative name server for the domain in the SOA resource record, while the primary master server does not need to be published.
Q: - What is Secondary name server/slave name server?
Secondary name server/slave name server acquires data about the zone by copying the data from the primary name server (respectively from the master server) at regular time intervals. It makes no sense to edit these databases on the secondary name servers, although they are saved on the local server disk because they will be rewritten during further copying.
Q: - what is Root name server?
Root name server is an authoritative name server for the root domain (for the dot). Each root name server is a primary server, which differentiates it from other name servers.
Q: - what is Stealth name server?
Stealth name server is a secret server. This type of name server is not published anywhere. It is only known to the servers that have its IP address statically listed in their configuration. It is an authoritative server. It acquires the data for the zone with the help of a zone transfer. It can be the main server for the zone. Stealth servers can be used as a local backup if the local servers are unavailable.
Q: - What do you mean by "Resource Records"?
Information on domain names and their IP addresses, as well as all the other information distributed via DNS is stored in the memory of name servers as Resource Records (RR).
Q: - Explain "TTL"?
Time to live. A 32-bit number indicating the time the particular RR can be kept valid in a server cache. When this time expires, the record has to be considered invalid. The value 0 keeps nonauthoritative servers from saving the RR to their cache memory.
Q: - Tell me 5 Types of DNS records?
A, NS, CNAME, SOA, PTR, MX.
This comment has been removed by the author.
ReplyDeleteBasic differences between TCP/IP and UDP.
ReplyDeleteTCP/IP
Transmission Control Protocol
It is connection Oriented
Reliable
TCP Acknowledgement will be sent/received
Slow Communication
Protocol Number for TCP is 6
HTTP, FTP, SMTP uses TCP
UDP
User Datagram Protocol
Connectionless
Non-reliable
No Acknowledgement for UDP
Faster Communication
Protocol Number for UDP is 17
DNS, DHCP uses UDP