Skip to content

Commit ba5efcb

Browse files
committed
Add the "Docker > Issues with DNS while running under a VPN" note.
1 parent 65c6196 commit ba5efcb

File tree

2 files changed

+36
-0
lines changed

2 files changed

+36
-0
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
+++
2+
title = "Issues with DNS while running under a VPN"
3+
+++
4+
5+
If you run a Docker container on a host that runs all network traffic through a VPN, you might encounter a situation where your Docker container's DNS resolver is not aware of the VPN's DNS servers. In fact, it is very likely to default to your ISP's DNS servers, which in turn may incur unwanted censoring.
6+
7+
A quick workaround is to override the default nameservers. For example, set the [`dns`](https://docs.docker.com/reference/compose-file/services/#dns) attribute on a service in a Docker Compose file:
8+
9+
```yaml
10+
services:
11+
service:
12+
image: host/owner/repo:latest
13+
restart: unless-stopped
14+
dns: 1.1.1.1
15+
networks:
16+
- network
17+
networks:
18+
network:
19+
```
20+
21+
Check the contents of the `/etc/resolv.conf` file inside the container afterwards.

content/notes/Docker/_index.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
+++
2+
title = "Docker"
3+
+++
4+
5+
A quote from Wikipedia:
6+
7+
> Docker is a tool that is used to automate the deployment of applications in lightweight containers so that applications can work efficiently in different environments in isolation.
8+
9+
Links:
10+
11+
- [Wikipedia](https://en.wikipedia.org/wiki/Docker_(software))
12+
13+
Child notes:
14+
15+
- [Issues with DNS while running under a VPN](@/notes/Docker/Issues_with_DNS_while_running_under_a_VPN.md)

0 commit comments

Comments
 (0)