Skip to content

Commit

Permalink
improve linux section of ingress-dns documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
gpelouze authored and medyagh committed May 24, 2024
1 parent f2049f0 commit f72619a
Showing 1 changed file with 21 additions and 10 deletions.
31 changes: 21 additions & 10 deletions site/content/en/docs/handbook/addons/ingress-dns.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,14 @@ minikube addons enable ingress-dns
{{% tabs %}}
{{% linuxtab %}}

On Linux, you should identify your domain name resolver configuration, and update its configuration accordingly. To that end, look at the first lines of `/etc/resolv.conf`:

- if it mentions `resolvconf`, resolution is likely handled by **resolvconf**,
- if it is `# Generated by NetworkManager`, resolution is handled by **NetworkManager**,
- if it similar to `# This is /run/systemd/resolve/stub-resolv.conf managed by man:systemd-resolved(8)`, resolution is handled by **systemd-resolved**.

Start minikube, and apply the configuration below matching your system configuration.

## Linux OS with resolvconf

Update the file `/etc/resolvconf/resolv.conf.d/base` to have the following contents.
Expand All @@ -71,7 +79,7 @@ nameserver 192.168.99.169
timeout 5
```

Replace `192.168.99.169` with your `minikube ip`.
Replace `192.168.99.169` with the output of `minikube ip`.

If your Linux OS uses `systemctl`, run the following commands.

Expand All @@ -88,39 +96,42 @@ If your Linux OS does not use `systemctl`, run the following commands.

See https://linux.die.net/man/5/resolver

## Linux OS with Network Manager

Network Manager can run integrated caching DNS server - `dnsmasq` plugin and can be configured to use separate nameservers per domain.
## Linux OS with NetworkManager

NetworkManager can run integrated caching DNS server - `dnsmasq` plugin and can be configured to use separate nameservers per domain.

Edit /etc/NetworkManager/NetworkManager.conf and set `dns=dnsmasq`
Edit `/etc/NetworkManager/NetworkManager.conf` and enable `dns=dnsmasq` by adding:

```
[main]
dns=dnsmasq
```

Also see `dns=` in [NetworkManager.conf](https://developer.gnome.org/NetworkManager/stable/NetworkManager.conf.html).

Configure dnsmasq to handle .test domain
Configure dnsmasq to handle domain names ending with `.test`:

```bash
sudo mkdir /etc/NetworkManager/dnsmasq.d/
sudo mkdir -p /etc/NetworkManager/dnsmasq.d/
echo "server=/test/$(minikube ip)" | sudo tee /etc/NetworkManager/dnsmasq.d/minikube.conf
```

Restart Network Manager
Restart Network Manager:

```
systemctl restart NetworkManager.service
```
Ensure your /etc/resolv.conf contains only single nameserver

Ensure your `/etc/resolv.conf` contains only single nameserver:

```bash
cat /etc/resolv.conf | grep nameserver
nameserver 127.0.0.1
```

## Linux OS with systemd-resolved

Your Linux OS likely uses `systemd-resolved` if the first line of `/etc/resolv.conf` contains `This is /run/systemd/resolve/stub-resolv.conf managed by man:systemd-resolved(8)`.

Run the following commands to add the minikube DNS for `.test` domains:

```bash
Expand Down

0 comments on commit f72619a

Please sign in to comment.