Resolver
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:
- when a cluster is brought up by Skyramp.
- 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
NOTE
If you are using WSL you must re-run this command when WSL is restarted or if the host network changes.
Failure to configure the DNS correctly will result in requests not reaching the test cluster.
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.
- Download Resolver on WSL by following the documentation for installing Skyramp.
- Download and install Docker Desktop.
- Ensure that Resolver is not running in WSL:
skyramp resolver stop
. - On Windows, open
Settings
and selectNetwork & internet
to view current DNS server configuration. - Edit
DNS Server Assignment
, and selectManual
DNS settings. - Set
Preferred DNS
value to127.0.0.1
andAlternate DNS
to the primary DNS server as listed in step 2.
Windows Settings
All Resolver specific commands can be run inside WSL now.
Note
In case of issues with DNS resolution on the Windows machine, revert theDNS Server Assignment
settings to Automatic
.