```sh
# 查看所在pod
[root@hy-node3 ~]# kubectl get pod -n kube-system
NAME                                       READY   STATUS    RESTARTS   AGE
calico-kube-controllers-7cc8dd57d9-jhvnj   1/1     Running   4          7d21h
calico-node-lm24q                          1/1     Running   9          20d
calico-node-p2pn4                          1/1     Running   5          20d
coredns-675db8b7cc-s6z7g                   1/1     Running   1          7d21h
snapshot-controller-0                      1/1     Running   0          7d6h
# 找到对应service,使用serviceip
[root@hy-node3 ~]# kubectl get svc -n kube-system
NAME                          TYPE        CLUSTER-IP   EXTERNAL-IP   PORT(S)                        AGE
kube-controller-manager-svc   ClusterIP   None         <none>        10257/TCP                      13d
kube-dns                      ClusterIP   10.96.0.2    <none>        53/UDP,53/TCP,9153/TCP         20d
kube-scheduler-svc            ClusterIP   None         <none>        10259/TCP                      13d
kubelet                       ClusterIP   None         <none>        10250/TCP,10255/TCP,4194/TCP   13d
# 找个ip查看dns是否能够解析
[root@hy-node3 ~]# kubectl get svc
NAME                     TYPE        CLUSTER-IP     EXTERNAL-IP   PORT(S)        AGE
kubernetes               ClusterIP   10.96.0.1      <none>        443/TCP        21d
nginx-service-nodeport   NodePort    10.96.231.91   <none>        80:30001/TCP   20d
# 解析测试
dig -t a www.baidu.com @10.96.0.2
[root@hy-node3 ~]# cat /etc/resolv.conf
# Generated by NetworkManager
nameserver 192.168.1.120
nameserver 223.6.6.6
nameserver 223.5.5.5
# 编辑coredns配置文件
 kubectl edit configmap coredns -n kube-system
```
![修改core-dns配置文件](img/QQ截图20230927214654.png)

```sh
# 查看是否可以滚动升级
[root@hy-node3 ~]# kubectl get deployment.apps -n kube-system
NAME                      READY   UP-TO-DATE   AVAILABLE   AGE
calico-kube-controllers   1/1     1            1           20d
coredns                   1/1     1            1           20d
[root@hy-node3 ~]# kubectl rollout restart deployment coredns -n kube-system
deployment.apps/coredns restarted
```