Git Product home page Git Product logo

Comments (7)

christopherhein avatar christopherhein commented on June 18, 2024 1

Seems like nslookup does purely DNS resolution but when you just add to the hosts file that's not populated in DNS. For /etc/hosts you should use ping or at least that's what https://askubuntu.com/questions/627906/why-is-my-etc-hosts-file-not-queried-when-nslookup-tries-to-resolve-an-address says.

from cluster-api-provider-nested.

charleszheng44 avatar charleszheng44 commented on June 18, 2024

@gyliu513 could you try to run nslookup cluster-sample-apiserver and share the output?

from cluster-api-provider-nested.

christopherhein avatar christopherhein commented on June 18, 2024

@charleszheng44 it appears macOS doesn't support HOSTALIASES - https://apple.stackexchange.com/questions/356972/how-can-i-make-macos-respect-hostaliases-environment-variable

from cluster-api-provider-nested.

christopherhein avatar christopherhein commented on June 18, 2024

/kind bug

from cluster-api-provider-nested.

gyliu513 avatar gyliu513 commented on June 18, 2024

@christopherhein @charleszheng44 seems Linux also does not work.

root@gyliu-dev21:~/go/src/github.com/kubernetes-sigs# cat /root/.hosts
127.0.0.1 cluster-sample-apiserver
root@gyliu-dev21:~/go/src/github.com/kubernetes-sigs# env | grep HOST
HOSTALIASES=/root/.hosts
root@gyliu-dev21:~/go/src/github.com/kubernetes-sigs# nslookup cluster-sample-apiserver
Server:		172.16.200.52
Address:	172.16.200.52#53

** server can't find cluster-sample-apiserver: NXDOMAIN
root@gyliu-dev21:~/go/src/github.com/kubernetes-sigs# kubectl --kubeconfig kubeconfig get all -A
Unable to connect to the server: dial tcp: lookup cluster-sample-apiserver on 172.16.200.52:53: no such host

from cluster-api-provider-nested.

christopherhein avatar christopherhein commented on June 18, 2024

Interesting, yeah I think we just need to have this say the instructions (for now) should tell you to just add it to /etc/hosts so it will actually work or at least that is what I do.

from cluster-api-provider-nested.

gyliu513 avatar gyliu513 commented on June 18, 2024

Thanks @christopherhein , /etc/hosts works for me, but not sure why nslookup cluster-sample-apiserver always failed.

Any side impact if we update /etc/hosts?

root@gyliu-dev21:~/go/src/github.com/kubernetes-sigs# kubectl --kubeconfig kubeconfig get all -A
NAMESPACE   NAME                 TYPE        CLUSTER-IP   EXTERNAL-IP   PORT(S)   AGE
default     service/kubernetes   ClusterIP   10.32.0.1    <none>        443/TCP   159m
root@gyliu-dev21:~/go/src/github.com/kubernetes-sigs# nslookup cluster-sample-apiserver
Server:		172.16.200.52
Address:	172.16.200.52#53

** server can't find cluster-sample-apiserver: NXDOMAIN
root@gyliu-dev21:~/go/src/github.com/kubernetes-sigs# cat /etc/hosts
127.0.0.1 localhost
127.0.0.1 cluster-sample-apiserver

# The following lines are desirable for IPv6 capable hosts
::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
172.16.164.91 gyliu-dev21.fyre.ibm.com gyliu-dev21

from cluster-api-provider-nested.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.