0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Kubernetesでnslookupしてみる

0
Last updated at Posted at 2024-06-06

TL;DR

dnsutilsをインストールして、nslookupを実行するだけです。
https://kubernetes.io/docs/tasks/administer-cluster/dns-debugging-resolution/

dnsutilsのインストール

$ kubectl apply -f https://k8s.io/examples/admin/dns/dnsutils.yaml
pod/dnsutils created


$ kubectl get pods dnsutils
NAME       READY   STATUS    RESTARTS   AGE
dnsutils   1/1     Running   0          20s

nslookupでDNSに問い合わせる

$ kubectl exec -i -t dnsutils -- nslookup prometheus-server.istio-system.svc.cluster.local
Server:         10.96.0.10
Address:        10.96.0.10#53

Name:   prometheus-server.istio-system.svc.cluster.local
Address: 10.97.230.212

$ kubectl exec -i -t dnsutils -- nslookup flagger-loadtester.test                         
Server:         10.96.0.10
Address:        10.96.0.10#53

** server can't find flagger-loadtester.test: NXDOMAIN

command terminated with exit code 1
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?