Linux network devices, NIC configuration, related

Source: Internet
Author: User
Tags curl nslookup

Tag:author    no    canonical    account    default    down   www.   rate   path   

  network device, NIC configuration: Eth0 is a physical network card: Unique MAC address, Bcast: Broadcast address, mask: Subnet mask, Lo: The IP address of the loopback that the system comes with, You can do some basic test applications, such as using 127 without a network card.  0.0.1,[email protected]: /# ifconfig ens33 Down (Stop a network card, restart the operating system can be played) [email protected]: /# ifconfig ens33 Up (start a network card) [ Email protected]: /# ifconfig ens33 192.168.115.129 (modify IP address for temporary effect, Configuration file can be permanently active) [email protected]: /# ifconfig ens33 192.168.115.129 netmask 255.255.255.0 (Modify subnet mask, temporary effect, configuration file can be permanently effective) [email protected]:  ~# hostname (root is the account, Ubuntu is the computer name) ubuntu[email protected]:  ~# hostname YAOWENPC (Modify host name, This is only a temporary change, reset after the restore, permanent modification to modify the configuration file) [email protected]: /# 
DNS: Resolve the domain name, the computer does not configure the DNS address is not able to access the Internet, the DNS address is provided by the supplier, to be manually designated, China Telecom Unicom will provide its own DNS address, no matter how the Internet is to go Network is telecommunications or Unicom, (Stray www.baidu.com need DNS to go to Baidu server) [email protected]:/etc# vim resolv.conf (View DNS config file) # Dynamic resolv.conf (5) file forGLIBC Resolver (3) generated by resolvconf (8) # do not EDIT the this FILE by HAND--YOUR Changes 'll be Overwrittennameserver127.0.1.1nameserver219.141.136.10: The dnsnameserver of telecommunications202.106.0.20: Unicom's DNS~[email protected]:/etc# Ping Www.baidu.comPING www.a.shifen.com (163.177.151.110) 56 (84) bytes of data.Bytes from 163.177.151.110:icmp_seq=1 ttl=128 time=13.9Ms Curl Tool (HTTP tool): Roo[email protected]:/etc# Curl-v-L www.baidu.com* Rebuilt URL to:www.baidu.com/* Trying 163.177.151.109...* Connected to Www.baidu.com (163.177.151.109) port (#0)> get/http/1.1>Host:www.baidu.com> user-agent:curl/7.47.0> Accept: */*> < http/1.1 ok< server:bfe/1.0.8.18< Date:thu, 2018 07:08:53 gmt< content-type:text/html < content-length:2381< Last-modified:mon, 13:27:57 gmt< connection:keep-alive< ETag: "588604dd- 94d "< Cache-control:private, No-cache, No-store, Proxy-revalidate, no-transform< pragma:no-cache< Set-Cookie : bdorz=27315; max-age=86400; domain=.baidu.com; path=/< accept-ranges:bytes< <! DOCTYPE html><!--STATUS ok-->Http://s1.bdstatic.com/r/www/cache/bdorz/baidu.min.css><title> Baidu A bit, you know </title>

# Curl Http://www.baidu.com >>/yw/baidu.html

Network Testing and testing tools: Troubleshooting network information: QQ can not be logged on, the mailbox can not be used, the Web page will not open. If your computer can not open a website, such as: Be strong, North-South interconnection (the South uses Unicom, the north used telecommunications, resulting in intermittent inaccessible). Ping is to send packets to the other host, ping the Gateway (gateway is a server capable of Internet access through the gateway to the Internet), if there is a packet return, indicating that the computer and gateway are interoperable, indicating that the local area network is interoperable. There are no DNS addresses to configure, computers to surf the internet, need domain name resolution, cat/etc/Resolv.conf[email protected]:/# nslookup (nslookup Verify there are no DNS addresses configured, DNS is configured right)>www.baidu.com (nslookup is a tool used to resolve domain names, enter www.baidu.com domain name) Server:127.0.1.1 (Server 127.0.1. 1 is the primary DNS server to resolve, there is no www.baidu.com this domain name, some words on the parse out, do not go to other DNS server to find) Address:127.0.1.1#53 (address:127.0.1.1#53, other DNS servers from 1 to 53 to find) Non-authoritative answer:www.baidu.com canonical name=www.a.shifen.com. (another 2 name and IP address of the Baidu server) Name:www.a.shifen.comaddress:163.177.151.109name:www.a.shifen.comaddress:163.177.151.110[email protected]:/# nslookup Www.baidu.comServer:127.0.1.1Address:127.0.1.1#53Non-authoritative answer:www.baidu.com canonical name=www.a.shifen.com.Name:www.a.shifen.comAddress:163.177.151.110name:www.a.shifen.comaddress:163.177.151.109to be able to surf the Internet: there must be an IP address to communicate with the gateway, DNS for domain name resolution, cat/etc/resolv.conf. Traceroute is the tracking route, the number of devices to visit Baidu. [Email protected]:/# traceroute Www.baidu.comtraceroute to Www.baidu.com (163.177.151.110), hops Max, 60bytePackets1 192.168.115.2 (192.168.115.2) 0.140 ms 0.056 MS 0.090Ms2 * * * 3 * * * 4 * * * 5 * * * 6 * * *[email protected]:/# netstat-rkernel IP Routing tabledestination Gateway genmask Flags MSS Window irtt Ifacedefault192.168.115.2 0.0.0.0 UG 0 0 0Ens33link-local * 255.255.0.0 U 0 0 0Ens33172.17.0.0 * 255.255.0.0 U 0 0 0Docker0192.168.115.0 * 255.255.255.0 U 0 0 0 Ens33

Linux network devices, NIC configuration, related

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.