首页 > 其他分享 >深入网络操作命令

深入网络操作命令

时间:2023-09-04 09:45:39浏览次数:39  
标签:操作命令 ms 网络 nginx 深入 RDONLY CLOEXEC lib64 open

深入网络操作命令

nslookup

# 可以查询域名指定类型的解析记录
nslookup www.baidu.com
# 出现解析不了域名的情况
修改/etc/resolv.conf文件,添加dns解析服务器

nmap

# 扫描端口开放情况
nmap www.baidu.com

strace

# 跟踪命令的调用情况,显示socket连接和open哪些配置文件
[root@VM-4-3-centos ~]# strace -e open,connect,socket nslookup www.baidu.com
open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
open("/lib64/libdns.so.1102", O_RDONLY|O_CLOEXEC) = 3
open("/lib64/liblwres.so.160", O_RDONLY|O_CLOEXEC) = 3
open("/lib64/libbind9.so.160", O_RDONLY|O_CLOEXEC) = 3
open("/lib64/libisccfg.so.160", O_RDONLY|O_CLOEXEC) = 3
open("/lib64/libisc.so.169", O_RDONLY|O_CLOEXEC) = 3
open("/lib64/libgssapi_krb5.so.2", O_RDONLY|O_CLOEXEC) = 3
open("/lib64/libkrb5.so.3", O_RDONLY|O_CLOEXEC) = 3
open("/lib64/libk5crypto.so.3", O_RDONLY|O_CLOEXEC) = 3
open("/lib64/libcom_err.so.2", O_RDONLY|O_CLOEXEC) = 3
open("/lib64/libcrypto.so.10", O_RDONLY|O_CLOEXEC) = 3
open("/lib64/libidn.so.11", O_RDONLY|O_CLOEXEC) = 3
open("/lib64/libcap.so.2", O_RDONLY|O_CLOEXEC) = 3
open("/lib64/libpthread.so.0", O_RDONLY|O_CLOEXEC) = 3
open("/lib64/libGeoIP.so.1", O_RDONLY|O_CLOEXEC) = 3
open("/lib64/libxml2.so.2", O_RDONLY|O_CLOEXEC) = 3
open("/lib64/libz.so.1", O_RDONLY|O_CLOEXEC) = 3
open("/lib64/libm.so.6", O_RDONLY|O_CLOEXEC) = 3
open("/lib64/libdl.so.2", O_RDONLY|O_CLOEXEC) = 3
open("/lib64/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
open("/lib64/libkrb5support.so.0", O_RDONLY|O_CLOEXEC) = 3
open("/lib64/libkeyutils.so.1", O_RDONLY|O_CLOEXEC) = 3
open("/lib64/libresolv.so.2", O_RDONLY|O_CLOEXEC) = 3
open("/lib64/libattr.so.1", O_RDONLY|O_CLOEXEC) = 3
open("/lib64/liblzma.so.5", O_RDONLY|O_CLOEXEC) = 3
open("/lib64/libselinux.so.1", O_RDONLY|O_CLOEXEC) = 3
open("/lib64/libpcre.so.1", O_RDONLY|O_CLOEXEC) = 3
open("/proc/filesystems", O_RDONLY)     = 3
open("/etc/pki/tls/legacy-settings", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/en_US.UTF-8/libdns.cat", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/en_US.UTF-8/LC_MESSAGES/libdns.cat", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/en/libdns.cat", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/en/LC_MESSAGES/libdns.cat", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/en_US.UTF-8/libisc.cat", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/en_US.UTF-8/LC_MESSAGES/libisc.cat", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/en/libisc.cat", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/en/LC_MESSAGES/libisc.cat", O_RDONLY) = -1 ENOENT (No such file or directory)
socket(AF_INET, SOCK_STREAM, IPPROTO_IP) = 3
socket(AF_INET6, SOCK_STREAM, IPPROTO_IP) = 3
socket(AF_UNIX, SOCK_STREAM, 0)         = 3
open("/proc/self/task/14433/comm", O_RDWR) = 3
open("/proc/self/task/14434/comm", O_RDWR) = 3
open("/proc/self/task/14435/comm", O_RDWR) = 6
open("/usr/share/locale/en_US.UTF-8/libdst.cat", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/en_US.UTF-8/LC_MESSAGES/libdst.cat", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/en/libdst.cat", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/en/LC_MESSAGES/libdst.cat", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/etc/pki/tls/openssl.cnf", O_RDONLY) = 6
open("/etc/resolv.conf", O_RDONLY)      = 6
open("/usr/lib/locale/locale-archive", O_RDONLY|O_CLOEXEC) = 6
Server:		183.60.83.19
Address:	183.60.83.19#53

Non-authoritative answer:
www.baidu.com	canonical name = www.a.shifen.com.
Name:	www.a.shifen.com
Address: 153.3.238.110
Name:	www.a.shifen.com
Address: 153.3.238.102

traceroute

[root@VM-4-3-centos ~]# traceroute www.baidu.com
traceroute to www.baidu.com (153.3.238.102), 30 hops max, 60 byte packets
 1  * * *
 2  * * *
 3  * * *
 4  10.200.66.125 (10.200.66.125)  3.569 ms 10.200.66.81 (10.200.66.81)  2.604 ms 10.200.66.89 (10.200.66.89)  3.488 ms
 5  10.162.5.110 (10.162.5.110)  1.614 ms 220.196.197.162 (220.196.197.162)  2.658 ms 10.162.5.110 (10.162.5.110)  1.653 ms
 6  220.196.197.161 (220.196.197.161)  3.234 ms  3.014 ms 220.196.197.169 (220.196.197.169)  3.189 ms
 7  211.95.32.109 (211.95.32.109)  3.481 ms 211.95.32.69 (211.95.32.69)  3.241 ms 211.95.32.125 (211.95.32.125)  5.259 ms
 8  219.158.17.18 (219.158.17.18)  9.426 ms  9.373 ms  10.216 ms
 9  153.3.228.130 (153.3.228.130)  8.300 ms  8.186 ms  8.567 ms
10  153.37.96.242 (153.37.96.242)  14.538 ms  12.000 ms  11.995 ms
11  182.61.255.184 (182.61.255.184)  9.254 ms 182.61.255.194 (182.61.255.194)  9.369 ms 182.61.255.186 (182.61.255.186)  9.258 ms
12  182.61.255.171 (182.61.255.171)  11.197 ms  11.275 ms 182.61.255.167 (182.61.255.167)  9.293 ms
13  * * *
14  * * *
15  * * *
16  * * *
17  * * *
18  * * *
19  * * *
20  * * *
21  * * *
22  * * *
23  * * *
24  * * *
25  * * *
26  * * *
27  * * *
28  * * *
29  * * *
30  * * *

mtr

# 快速的查看路由情况,一般看最后两个节点
[root@VM-4-3-centos ~]# mtr www.baidu.com

lsof

# 快速查看进程打开了哪些文件
[root@VM-4-3-centos ~]# lsof |grep nginx|grep log
nginx     27660                 root    2w      REG              253,1      3550    1186589 /var/log/nginx/error.log
nginx     27660                 root    4w      REG              253,1      3550    1186589 /var/log/nginx/error.log
nginx     27660                 root    5w      REG              253,1      9437    1186588 /var/log/nginx/access.log
nginx     27661                nginx    2w      REG              253,1      3550    1186589 /var/log/nginx/error.log
nginx     27661                nginx    4w      REG              253,1      3550    1186589 /var/log/nginx/error.log
nginx     27661                nginx    5w      REG              253,1      9437    1186588 /var/log/nginx/access.log
nginx     27662                nginx    2w      REG              253,1      3550    1186589 /var/log/nginx/error.log
nginx     27662                nginx    4w      REG              253,1      3550    1186589 /var/log/nginx/error.log
nginx     27662                nginx    5w      REG              253,1      9437    1186588 /var/log/nginx/access.log

# 查看网络连接
[root@VM-4-3-centos ~]# lsof -i:80
COMMAND   PID  USER   FD   TYPE   DEVICE SIZE/OFF NODE NAME
nginx   27660  root    6u  IPv4 62447989      0t0  TCP *:http (LISTEN)
nginx   27661 nginx    6u  IPv4 62447989      0t0  TCP *:http (LISTEN)
nginx   27662 nginx    6u  IPv4 62447989      0t0  TCP *:http (LISTEN)

标签:操作命令,ms,网络,nginx,深入,RDONLY,CLOEXEC,lib64,open
From: https://www.cnblogs.com/louvice/p/17676095.html

相关文章

  • 9层次化网络设计
    分层设计三层模型核心层:主要高速数据交换实现高速数据传输,出口路由,常用冗余机制汇聚层:网络访问策略控制,数据包处理和过滤,策略路由,广播域定义、寻址接入层:主要是针对用户端,实现用户接入,计费管理,MAC地址认证,MAC地址过滤,收集用户信息可以使用集线器替代交换机......
  • 高速接口_(10Gbps )万兆网络中物理编码层 64B66B 编码解码实现
    万兆网络中物理编码层64B66B编码解码实现目的万兆以太网的物理编码层(PCS)的编码和解码工作原理和实现方法使用赛灵思官方提供的GTWizardIP来配置和控制高速接口的参数和功能实现自定义的64B66B编码器和解码器,并进行了测试和验证使用自定义的数据或标准的以太网数据来......
  • 【机哥】基于神经网络的图像去噪器
    鱼弦:全栈领域创作新星创作者、51CTO(Top红人+专家博主)、github开源爱好者(go-zero源码二次开发、游戏后端架构https://github.com/Peakchen)基于神经网络的图像去噪器是一种利用深度学习技术来降低图像噪声的方法。它通过训练一个神经网络模型,将含有噪声的图像作为输入,输出一张更......
  • STM32深入学习3:GPIO模块控制LED(寄存器版)
    GPIO模块数据手册详解:GPIO:通用输入/输出AFIO:备用输入/输出GPIOx_CRL和GPIOx_CRH:配置寄存器GPIOx_IDR和GPIOx_ODR:数据寄存器GPIOx_BSRR:置位/复位寄存器GPIOx_BRR:复位寄存器GPIOx_LCKR:锁定寄存器,锁定GPIO的数值GPIO模式:1.输入浮动:完全由外部决定2.输入上拉和输入下拉:存在......
  • Windows与网络基础——虚拟机镜像相关
    1.虚拟机Windows10安装硬盘分区时,先新建分区,再格式化在启动此电脑——管理——本地用户和组 向下箭头代表为禁用开机状态快照占用内存大于关机状态快照2.虚拟机WindowsServer2016安装要桌面的话,需要选择桌面体验版Server版本的WINDOWS需要给管理员设置密码,且具备复杂性,......
  • 高性能网络通信模型——Reactor 和 Proactor
    原来8张图,就能学废Reactor和Proactor(qq.com)高并发编程--Reactor模式与Proactor模式(qq.com)Reactor模型Reactor,翻译为反应器,他是一个被动的感觉,可以理解为接收到客户端事件后,Reactor模型会根据事件类型调用相应的代码进行处理。Reactor模型也叫作Dispatcher模式,底层是......
  • Lnton羚通智能分析算法道路病害识别监测系统,使用CNN网络深度学习算法
    道路病害识别监测系统通过CNN网络深度学习算法,道路病害识别监测对巡检车上实时监控道路影像数据进行分析,输出道路病害裂缝巡检报告并落图展示。卷积神经网络(ConvolutionalNeuralNetwork,CNN)在图像处理和图像识别任务中取得了很大的成功。它通过卷积层、池化层和全连接层的组......
  • 网络流学习笔记
    开个坑,是个大工程,一篇可能放不下,所以后续存在形式未知。每周日写一个小时,大概会写很久,目前处于一个咕咕的状态。笔者是主要从Alex_wei的博客中学习网络流,因此本文有很多东西来自wls的博客,wlstql。1.一些有关概念网络是一张有向图\(G=(V,E)\),每条边\((u,v)\)具有流量......
  • Lnton羚通智能分析算法灭火器摆放识别检测算法, 使用python+yolo网络深度学习技术
    灭火器摆放识别检测算法通过python+yolo网络深度学习技术,自动对指定区域灭火器是否缺失进行识别,如果没有检测到指定区域有灭火器,立即抓拍存档进行告警。YOLO系列算法是一类典型的one-stage目标检测算法,其利用anchorbox将分类与目标定位的回归问题结合起来,从而做到了高效、灵活和......
  • 记VirtualBox+Ubuntu20.4网络配置(网络互通)
    场景原先使用桥接模式确实可以满足主机与虚拟机互通,且虚拟机可访问外网。但是不知是不是就我出现这问题——选择桥接模式,主机需要打开热点,而又由于未知原因在开热点的情况下,主机网络会有一定的影响(有时很卡)。故而,想着切换一下网络配置。工具版本VirtualBox7.0.8Ubuntu20.4......