1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
| # 类似于docker指令: docker run --user root -it busybox:1.28.4 sh
[root@k8s-node1 ~]# kubectl run --image busybox:1.28.4 dns-test --restart=Never --rm -it -- sh
If you don't see a command prompt, try pressing enter.
/ #
/ # cat /etc/resolv.conf
nameserver 10.96.0.10
search default.svc.cluster.local svc.cluster.local cluster.local zhch.lan
options ndots:5
/ #
/ # nslookup kube-dns.kube-system
Server: 10.96.0.10
Address 1: 10.96.0.10 kube-dns.kube-system.svc.cluster.local
Name: kube-dns.kube-system
Address 1: 10.96.0.10 kube-dns.kube-system.svc.cluster.local
/ #
/ # nslookup sonarqube.devops
Server: 10.96.0.10
Address 1: 10.96.0.10 kube-dns.kube-system.svc.cluster.local
Name: sonarqube.devops
Address 1: 10.109.14.183 sonarqube.devops.svc.cluster.local
/ #
/ # nslookup harbor.zhch.lan
Server: 10.96.0.10
Address 1: 10.96.0.10 kube-dns.kube-system.svc.cluster.local
Name: harbor.zhch.lan
Address 1: 192.168.99.240 ingress-nginx-controller.ingress-nginx.svc.cluster.local
/ #
/ # nslookup git.zhch.lan
Server: 10.96.0.10
Address 1: 10.96.0.10 kube-dns.kube-system.svc.cluster.local
Name: git.zhch.lan
Address 1: 192.168.99.240 ingress-nginx-controller.ingress-nginx.svc.cluster.local
/ #
/ # nslookup baidu.com
Server: 10.96.0.10
Address 1: 10.96.0.10 kube-dns.kube-system.svc.cluster.local
Name: baidu.com
Address 1: 110.242.68.66
Address 2: 39.156.66.10
/ #
|