Skip to content

feat(network): add support for forward guest localhost DNS for unikraft - #966

Draft
alimx07 wants to merge 2 commits into
urunc-dev:mainfrom
alimx07:feat/unikraft-dns
Draft

feat(network): add support for forward guest localhost DNS for unikraft#966
alimx07 wants to merge 2 commits into
urunc-dev:mainfrom
alimx07:feat/unikraft-dns

Conversation

@alimx07

@alimx07 alimx07 commented Aug 13, 2026

Copy link
Copy Markdown

Description

This PR will add support for localhost semantics added in #793 for unikraft unikernels. This will be done by modifying the CMD line defined here:

u.configureUnikraftArgs(data.Rootfs.Type, data.Net.IP, data.Net.Gateway, data.Net.Mask, data.Net.DNSServer)

as the new DNSServer will be either:

  • the Default 8.8.8.8
  • The Custom one defined in internal/constants/network_constants (e.g. 192.168.100.100)

The exact of this happens is defined in #793 but as breif, we detect if we have localhost resolvers ,then rewrite them to point to our Custom resolver, where we apply TC rules to intercept traffic and redirect it according to our rules

Related issues

How was this tested?

LLM usage

Checklist

  • I have read the contribution guide.
  • The linter passes locally (make lint).
  • The e2e tests of at least one tool pass locally (make test_ctr, make test_nerdctl, make test_docker, make test_crictl).
  • If LLMs were used: I have read the llm policy.

…dcoded 8.8.8.8

Adds NetDevParams.DNSServer so the network manager can pass a resolver IP
(e.g. from localhost DNS forwarding) through to the Unikraft netdev cmdline.
Falls back to 8.8.8.8 when unset, preserving current behavior.
@netlify

netlify Bot commented Aug 13, 2026

Copy link
Copy Markdown

Deploy Preview for urunc canceled.

Name Link
🔨 Latest commit 8ea34bd
🔍 Latest deploy log https://app.netlify.com/projects/urunc/deploys/6a7d8b010ada62000808774b

@alimx07 alimx07 changed the title Feat/unikraft dns feat(network): add support for forward guest localhost DNS for unikraft Aug 13, 2026

@cmainas cmainas left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @alimx07 , this looks good, We can merge it directly.

@cmainas

cmainas commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

However, please complete the PR description correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants