-
Notifications
You must be signed in to change notification settings - Fork 7.7k
add another iptables rule to allow dns queries from container #21708
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
✅ Deploy Preview for docsdocker ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @fliespl ... a hint like this to go along with the existing examples looks useful, without taking us too far down the path of providing general iptables
documentation.
@@ -119,6 +119,11 @@ the source and destination. For instance, if the Docker host has addresses | |||
`2001:db8:1111::2` and `2001:db8:2222::2`, you can make rules specific to | |||
`2001:db8:1111::2` and leave `2001:db8:2222::2` open. | |||
|
|||
If your containers are also querying DNS, you should add this rule as well to allow them to work: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The suggested rule isn't specific to DNS, it accepts any incoming or outgoing packet that's part of a flow that's already been allowed by some other rule.
So, how about ...
If your containers are also querying DNS, you should add this rule as well to allow them to work: | |
You may need to allow responses from servers outside the permitted external address ranges. For example, containers may send DNS or HTTP requests to hosts that are not allowed to access the container's services. The following rule accepts any incoming or outgoing packet belonging to a flow that has already been accepted by other rules. It must be placed before `DROP` rules that restrict access from external address ranges. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeap, this makes much more sense :)
``` | ||
$ iptables -I DOCKER-USER -m state --state RELATED,ESTABLISHED -j ACCEPT | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you're updating, can you also;
- add a newline before the code-block
- add a
console
code-hint to make sure it's properly highlighted?
``` | |
$ iptables -I DOCKER-USER -m state --state RELATED,ESTABLISHED -j ACCEPT | |
``` | |
```console | |
$ iptables -I DOCKER-USER -m state --state RELATED,ESTABLISHED -j ACCEPT | |
``` |
Thanks for the pull request. We'd like to make our product docs better, but haven’t been able to review all the suggestions. If the updates are still relevant, review our contribution guidelines and rebase your pull request against the latest version of the docs, then mark it as fresh with a Prevent pull requests from auto-closing with a /lifecycle stale |
Co-authored-by: Rob Murray <[email protected]> Co-authored-by: fliespl <[email protected]> Signed-off-by: Sebastiaan van Stijn <[email protected]>
@robmry @aevesdocker I rebased this one and applied your suggestions; PTAL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - thank you.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Description
With only mentioned rule, DNS queries from containers won't work.
Reviews