<p>Following <a href="https://kubernetes.github.io/ingress-nginx/deploy/#installation-guide" rel="nofollow noreferrer">https://kubernetes.github.io/ingress-nginx/deploy/#installation-guide</a></p>
<pre><code>kubectl create deployment demo --image=httpd --port=80
kubectl expose deployment demo
kubectl create ingress demo-localhost --class=nginx \
  --rule=&quot;demo.localdev.me/*=demo:80&quot;
kubectl port-forward --namespace=ingress-nginx service/ingress-nginx-controller 8080:80
</code></pre>
<p>how the domain &quot;demo.localdev.me&quot; is resolved to localhost?</p>
<pre><code> &gt; curl http://demo.localdev.me:8080
 &lt;html&gt;&lt;body&gt;&lt;h1&gt;It works!&lt;/h1&gt;&lt;/body&gt;&lt;/html&gt;
</code></pre>
<p>The domain &quot;demo.localdev.me&quot; is not in the c:\Windows\System32\drivers\etc\hosts file on windows 11. Is it added to a DNS server?</p>

eastwater
<p>Domain names or IP addresses on a local computer can be resolved by adding entries in the local hosts file on a computer (<code>C:\Windows\System32\drivers\etc</code> → for windows) . Go to this path and set up the hostname.</p>
<p>Before adding it check if the dns is already configured by using <code>nslookup host_name</code>.If you don’t find it in dns you need to add it.</p>
<p>As per <a href="https://minikube.sigs.k8s.io/docs/drivers/docker/#known-issues" rel="nofollow noreferrer">official doc</a>:</p>
<blockquote>
<p>The ingress, and ingress-dns addons are currently only supported on
Linux.</p>
</blockquote>
<p>If you have already used <code>minikube addons enable ingress</code>, Try <code>minikube tunnel</code> and your ingress resources would be available at <code>127.0.0.1</code>. So the requests from <code>http://demo.localdev.me:8080</code> will be sent to <code>127.0.0.1</code>.</p>
<p>Refer to the <a href="https://minikube.sigs.k8s.io/docs/handbook/addons/ingress-dns/" rel="nofollow noreferrer">official doc</a> and <a href="https://snehalhingane1998.medium.com/configuring-dns-server-for-kubernetes-clusters-384cddb4f11d" rel="nofollow noreferrer">blog</a> authored by Snehalhingane for more information.</p>
