# How to enable internet access inside a NixOS container

**URL:** https://discourse.nixosstag.fcio.net/t/how-to-enable-internet-access-inside-a-nixos-container/62458
**Category:** Guides
**Created:** [March 31, 2025, 11:28pm UTC](https://discourse.nixosstag.fcio.net/t/how-to-enable-internet-access-inside-a-nixos-container/62458 "2025-03-31T23:28:59Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![ursi](https://discourse.nixosstag.fcio.net/user_avatar/discourse.nixosstag.fcio.net/ursi/32/3842_2.png) [@ursi](https://discourse.nixosstag.fcio.net/u/ursi)
#### Post date: [March 31, 2025, 11:28pm UTC](https://discourse.nixosstag.fcio.net/t/how-to-enable-internet-access-inside-a-nixos-container/62458/1 "2025-03-31T23:28:59Z")

</div>

I was unable to find a straightforward guide on how to get internet access inside a NixOS container. So upon figuring it out, I am sharing.

# Container

```auto
networking.useHostResolvConf = false;
services.resolved.enable = true;

```

# Host

```auto
networking.nat.enable = true;

```

Disclaimer: at the time of writing, I do not have a good understanding of these things whatsoever. So there very well may be some other host options required that I’m not aware of that I already happen to have set on my system. If you’re aware of any of these, do let me know and I’ll update the post.
