$ cat /etc/resolv.conf # Dynamic resolv.conf(5) filefor glibc resolver(3) generated by resolvconf(8) # DO NOT EDIT THIS FILEBY HAND -- YOUR CHANGES WILL BE OVERWRITTEN nameserver 127.0.1.1
好吧,不过我已经知道了。您的 Linux 发行版可能配置不同,您会看到您的上游服务器。接下来我们来试试网络管理器命令行工具 nmcli:
1 2 3
$ nmcli devshow | grep DNS IP4.DNS[1]: 192.168.1.1
Starting Nmap 7.01 ( https://nmap.org ) at2018-01-1416:46 PST Nmap scan report for Mobile.Hotspot (192.168.1.1) Host is up (0.0071s latency). Not shown: 997 closed ports PORT STATE SERVICE VERSION 22/tcp filtered ssh 53/tcp open domain dnsmasq 2.55 80/tcp openhttp GoAhead WebServer 2.5.0
Nmap scan report for studio (192.168.1.102) Host is up (0.000087s latency). Not shown: 998 closed ports PORT STATE SERVICE VERSION 22/tcp open ssh OpenSSH 7.2p2 Ubuntu 4ubuntu2.2 (Ubuntu Linux; protocol 2.0) 631/tcp open ipp CUPS 2.1 Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel
Service detection performed. Please report any incorrect results athttps://nmap.org/submit/ . Nmap done: 256 IP addresses (2 hosts up) scanned in11.65seconds
这些是有趣的结果。让我们尝试从不同的互联网连接进行相同的操作,以查看这些服务是否暴露于互联网中。如果您有智能手机,相当于您有第二个网络。您可以下载应用程序,还可以为您的 Linux 电脑提供热点。从热点控制面板获取广域网IP地址,然后重试:
1 2 3 4 5 6 7
$ nmap -sV 12.34.56.78
Starting Nmap 7.01 ( https://nmap.org ) at 2018-01-1417:05 PST Nmap scan report for12.34.56.78 Host isup (0.0061s latency). All 1000 scanned ports on12.34.56.78 are closed