<p>I am deploying statefulset in my local PC (for doing research) follow this <a href="https://kubernetes.io/docs/tutorials/stateful-application/basic-stateful-set/" rel="nofollow noreferrer">link</a></p>

<p>In this step:</p>

<pre><code>kubectl run -i --tty --image busybox:1.28 dns-test --restart=Never --rm  
nslookup web-0.nginx
</code></pre>

<p>I meet this error:</p>

<pre><code>nslookup web-0.nginx
Server:    10.96.0.10
Address 1: 10.96.0.10

nslookup: can't resolve 'web-0.nginx'
</code></pre>

<p>My pod and node are still working correctly and my coredns is running correctly</p>

<pre><code>kube-system   coredns-fb8b8dccf-hbrhw           1/1     Running   0       26m
kube-system   coredns-fb8b8dccf-rmrwp           1/1     Running   0       26m


nguyen@kmaster:~/Documents$ kubectl get --all-namespaces=true -o wide pods
NAMESPACE     NAME                              READY   STATUS    RESTARTS   AGE   IP                NODE      NOMINATED NODE   READINESS GATES
default       busybox                           1/1     Running   1          65m   10.244.1.218      knode     &lt;none&gt;           &lt;none&gt;
default       web-0                             1/1     Running   0          75m   10.244.1.215      knode     &lt;none&gt;           &lt;none&gt;
default       web-1                             1/1     Running   0          75m   10.244.1.216      knode     &lt;none&gt;           &lt;none&gt;
kube-system   coredns-fb8b8dccf-hbrhw           1/1     Running   0          51m   10.244.1.219      knode     &lt;none&gt;           &lt;none&gt;
kube-system   coredns-fb8b8dccf-rmrwp           1/1     Running   0          51m   10.244.0.37       kmaster   &lt;none&gt;           &lt;none&gt;
kube-system   etcd-kmaster                      1/1     Running   20         20d   192.168.146.132   kmaster   &lt;none&gt;           &lt;none&gt;
kube-system   kube-apiserver-kmaster            1/1     Running   514        20d   192.168.146.132   kmaster   &lt;none&gt;           &lt;none&gt;
kube-system   kube-controller-manager-kmaster   1/1     Running   144        20d   192.168.146.132   kmaster   &lt;none&gt;           &lt;none&gt;
kube-system   kube-flannel-ds-amd64-ndpjq       1/1     Running   0          76m   192.168.146.129   knode     &lt;none&gt;           &lt;none&gt;
kube-system   kube-flannel-ds-amd64-s2vhp       1/1     Running   0          76m   192.168.146.132   kmaster   &lt;none&gt;           &lt;none&gt;
kube-system   kube-proxy-dk5jd                  1/1     Running   6          20d   192.168.146.132   kmaster   &lt;none&gt;           &lt;none&gt;
kube-system   kube-proxy-ts79l                  1/1     Running   2          20d   192.168.146.129   knode     &lt;none&gt;           &lt;none&gt;
kube-system   kube-scheduler-kmaster            1/1     Running   172        20d   192.168.146.132   kmaster   &lt;none&gt;           &lt;none&gt;

nguyen@kmaster:~$ kubectl get svc 
NAME         TYPE        CLUSTER-IP  EXTERNAL-IP   PORT(S)   AGE
kubernetes   ClusterIP   10.96.0.1    &lt;none&gt;        443/TCP   21d
nginx        ClusterIP   None         &lt;none&gt;        80/TCP    6h8m
</code></pre>

<p>Did I miss something? Someone can help me.
Thank you!</p>

nguyennd
<p>nginx statefulset is deployed in default namespace as shown below</p>

<pre><code>default       web-0                             1/1     Running   0          75m   10.244.1.215      knode     &lt;none&gt;           &lt;none&gt;
default       web-1                             1/1     Running   0          75m   10.244.1.216      knode     &lt;none&gt;           &lt;none&gt;
</code></pre>

<p>This is how you should test</p>

<pre><code>master $ kubectl get po
NAME      READY     STATUS    RESTARTS   AGE
web-0     1/1       Running   0          1m
web-1     1/1       Running   0          1m

master $ kubectl get svc
NAME         TYPE        CLUSTER-IP   EXTERNAL-IP   PORT(S)   AGE
kubernetes   ClusterIP   10.96.0.1    &lt;none&gt;        443/TCP   35m
nginx        ClusterIP   None         &lt;none&gt;        80/TCP    2m
master $ kubectl run -i --tty --image busybox:1.28 dns-test --restart=Never --rm
If you don't see a command prompt, try pressing enter.
/ # nslookup nginx
Server:    10.96.0.10
Address 1: 10.96.0.10 kube-dns.kube-system.svc.cluster.local

Name:      nginx
Address 1: 10.40.0.1 web-0.nginx.default.svc.cluster.local
Address 2: 10.40.0.2 web-1.nginx.default.svc.cluster.local
/ #
/ # nslookup web-0.nginx
Server:    10.96.0.10
Address 1: 10.96.0.10 kube-dns.kube-system.svc.cluster.local

Name:      web-0.nginx
Address 1: 10.40.0.1 web-0.nginx.default.svc.cluster.local

/ # nslookup web-0.nginx.default.svc.cluster.local
Server:    10.96.0.10
Address 1: 10.96.0.10 kube-dns.kube-system.svc.cluster.local

Name:      web-0.nginx.default.svc.cluster.local
Address 1: 10.40.0.1 web-0.nginx.default.svc.cluster.local
</code></pre>
