<p>K8s network policies allow specifying CIDRs, but I'd like to specify DNS name.</p>
<p>On a high level I'd see it working the following way:</p>
<ul>
<li>There's a whitelist of allowed hosts</li>
<li>k8s intercepts IP resolution requests and checks whether host is whitelisted</li>
<li>if yes, resolved IPs are temporarily added to network policy thus allowing for egress traffic</li>
</ul>
<p>Is there any way to achieve this functionality?</p>

<p>vpc-cni does not implement k8s network policies. You need to replace vpc-cni with one of the EKS compatible CNI of your choice <a href="https://docs.aws.amazon.com/eks/latest/userguide/alternate-cni-plugins.html" rel="nofollow noreferrer">here</a> that support using FQDN in the policy. Note upgrade may be required (eg. Calico Enterprise) to have this feature.</p>
