7-Network configuration under Linux

ipconfig under win

ifconfig under linux

ping test connectivity between hosts

Set hostname and hosts mapping

set hostname

  • Check the hostname:hostname
  • Modify the host name: vim /etc/hostname, it will take effect after reboot
    ![[1-Linux directory structure#^f9a9d2]]

Set hosts mapping

In win:

C:\Windows\System32\drivers\etc\hosts

In linux:

Modify the /etc/hosts file to specify

Host name resolution analysis process

image.png|center|600

hosts

"hosts" is a file on your computer that maps hostnames to IP addresses.

It is typically used to set custom hostname resolution rules on the local computer. By editing the hosts file, you can map specific hostnames to specific IP addresses, so that when you access these hostnames in a browser or other web application, you can directly use the specified IP address to connect. This is useful for testing websites, blocking malicious websites, or developing and debugging in a local environment.

DNS

DNS stands for Domain Name System (Domain Name System).

It is a network protocol in the Internet, which is used to convert domain names (such as example.com) into IP addresses (such as 192.0.2.1), so that computers can identify and access specific network resources.

DNS acts like a phone book, helping users locate and access websites, email servers, and other web services on the Internet.

Guess you like

Origin blog.csdn.net/qq_45575167/article/details/131947851