TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

The life of a DNS query in Kubernetes

18 点作者 pul超过 2 年前

2 条评论

dpifke超过 2 年前
Minor nit: in the diagram labeled &quot;the flow of a DNS query in Kubernetes,&quot; it says a DNS query is a syscall. That is incorrect: DNS lookups happen in userspace, not the kernel.<p>This is usually by calling a library function in libc, but sometimes not. For example, most programs written in Go (such as Kubernetes itself) use their own resolver instead of <a href="https:&#x2F;&#x2F;www.man7.org&#x2F;linux&#x2F;man-pages&#x2F;man3&#x2F;getaddrinfo.3.html" rel="nofollow">https:&#x2F;&#x2F;www.man7.org&#x2F;linux&#x2F;man-pages&#x2F;man3&#x2F;getaddrinfo.3.html</a> (or its predecessor, <a href="https:&#x2F;&#x2F;www.man7.org&#x2F;linux&#x2F;man-pages&#x2F;man3&#x2F;gethostbyname.3.html" rel="nofollow">https:&#x2F;&#x2F;www.man7.org&#x2F;linux&#x2F;man-pages&#x2F;man3&#x2F;gethostbyname.3.ht...</a>). This can lead to &quot;fun&quot; issues where the behavior between resolvers diverges, such as <a href="https:&#x2F;&#x2F;github.com&#x2F;golang&#x2F;go&#x2F;issues&#x2F;15419">https:&#x2F;&#x2F;github.com&#x2F;golang&#x2F;go&#x2F;issues&#x2F;15419</a>.
评论 #34095903 未加载
评论 #34097564 未加载
bogomipz超过 2 年前
The author states:<p>&gt;&quot;When a pod performs a DNS lookup, the query is first sent to the local DNS resolver in the pod. This resolver uses the resolv.conf configuration file. In this file, the nodelocaldns server is set up as the default recursive DNS resolver, which acts as a cache.&quot;<p>and then:<p>&gt;&quot;Here&#x27;s the TLDR. When a pod performs a DNS lookup, the query is first sent to the DNS cache on the node where the pod is running. If the cache does not contain the IP address for the requested hostname, the query is forwarded to the cluster DNS server.&quot;<p>It&#x27;s somewhat bizarre to include an optional add-on component such a node-local DNS as part of a discussion about the default name resolution flow in Kubernetes. It is only towards the end of the post that the author mentions that node-local DNS is not actually a default component in Kubernetes.