Resolver

Manage DNS resolution to your Kubernetes clusters

Skyramp runs a Dnsmasq container, called Resolver, on the local machine to resolve addresses under the skyramp.test domain. Resolver can also be used to configure access to other kubernetes clusters not managed by Skyramp.

Resolver uses port mapping 5553:53 on MAC and 53:53 on WSL (Windows Subsystem for Linux), and is automatically started when new domain configurations are added.

Before you begin

Resolver commands can be triggered via the Skyramp binary. Follow instructions here to install Skyramp.

Resolver works out of the box on Linux, macOS, and WSL (Windows Subsystem for Linux). To use it on Windows, follow the additional configuration steps.

Start Resolver

Skyramp automatically starts Resolver in two cases:

  1. when a cluster is brought up by Skyramp.
  2. when a new configuration is added to Resolver via the config add command.

To force start Resolver, you can run the following command:

skyramp resolver start

Add domain

As noted earlier, the skyramp.test domain is automatically added to Resolver for clusters brought up by Skyramp. To add a new domain, run the following command:

skyramp resolver config add --domain <domain> --ip <ip>

Based on the Operating System you are on, Skyramp makes the appropriate configurations as follows:

MAC : A new domain configuration is created in the /etc/resolver directory for each configured domain.

Linux (Ubuntu): Skyramp updates the configuration file at /etc/systemd/resolved.conf with the IP of the resolver container and restarts the systemd-resolved service.

Windows: Skyramp updates the configuration file at /etc/resolv.conf with the Resolver container as the first nameserver.

View configuration

You can view all DNS resolutions configured by Resolver by running:

skyramp resolver config show

Verify configuration

Test the configuration by performing a ping to any configured domain.

  ping  -c 1 <domain>

Example result:

  PING <domain> (127.0.0.1): 56 data bytes
  64 bytes from 127.0.0.1: icmp_seq=0 ttl=64 time=0.033 ms

  --- <domain> ping statistics ---
  1 packets transmitted, 1 packets received, 0.0% packet loss
  round-trip min/avg/max/stddev = 0.033/0.033/0.033/0.000 ms

Remove domain

List configured domains for the skyramp resolver by running:

skyramp resolver config remove --domain <domain>

Stop Resolver

You can stop Resolver at any time by running the stop command.

skyramp resolver stop

Windows Configuration

While Resolver works out of the box on WSL, additional configuration is needed to use it on Windows.

  1. Download Resolver on WSL by following the documentation for installing Skyramp.
  2. Download and install Docker Desktop.
  3. Ensure that Resolver is not running in WSL: skyramp resolver stop.
  4. On Windows, open Settings and select Network & internet to view current DNS server configuration.
  5. Edit DNS Server Assignment, and select Manual DNS settings.
  6. Set Preferred DNS value to 127.0.0.1 and Alternate DNS to the primary DNS server as listed in step 2.

    Windows Settings

All Resolver specific commands can be run inside WSL now.