<p>Can I use <a href="https://github.com/coredns/policy#domain-name-policy" rel="nofollow noreferrer">coredns Domain name policy</a>
to restrict or control egress call.<br/> For example I want to allow <code>google.com</code> and block <code>gitHub.com</code>. What implementation steps required to do this if I had kubernetes setup ready and default <code>coredns</code> pod running in it.</p>

gaurav sinha
<p>I have done this recently using <a href="https://github.com/monzo/egress-operator" rel="nofollow noreferrer">egress-operator</a>. You have to configure this with coredns image that you will build (follow the Readme) and it will route your egress traffic through the operator.</p>
<p>On the operator <a href="https://github.com/monzo/egress-operator#usage" rel="nofollow noreferrer">external service</a> you can whitelist the domains.</p>
<p><strong>Note:</strong> Try to use docker local registry first instead of cloud to avoid push-pull delay</p>
