Skip to content

Instantly share code, notes, and snippets.

@yushijinhun
Created April 29, 2021 10:19
Show Gist options
  • Save yushijinhun/f4f4cf26d72d44b93c28ea7c5e03042b to your computer and use it in GitHub Desktop.
Save yushijinhun/f4f4cf26d72d44b93c28ea7c5e03042b to your computer and use it in GitHub Desktop.
[LXD] Resolve .lxd domains

Steps

Check your host IP address on LXD network interface:

$ lxc network show lxdbr0
config:
  ipv4.address: 172.17.233.1/24 # <--- IP address is 172.17.233.1
...

Edit /etc/systemd/resolved.conf.d/lxdbr0.conf:

[Resolve]
DNS=172.17.233.1 # Replace this with the IP address you obtained in the previous step
Domains=~lxd

Test environment

  • Host: Ubuntu 21.04 (LXD 4.13)
  • This method should apply to all systems using systemd-resolved.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment