Bug vSphere - Limit the number of nameservers to 3
@@ -48,6 +48,8 @@ contents:
-e "/Generated by/c# Generated by KNI resolv prepender NM dispatcher script\nsearch $DOMAIN\nnameserver $NAMESERVER_IP" \
/var/run/NetworkManager/resolv.conf > /etc/resolv.tmp
fi
+ # Only leave the first 3 nameservers in /etc/resolv.conf
+ sed -i ':a $!{N; ba}; s/\(^\|\n\)nameserver/\n# nameserver/4g' /etc/resolv.tmp
mv -f /etc/resolv.tmp /etc/resolv.conf
;;
*)
