diff --git a/plugins/check_dns_replication b/plugins/check_dns_replication
index 56e54d7..4b70fb4 100755
--- a/plugins/check_dns_replication
+++ b/plugins/check_dns_replication
@@ -56,8 +56,8 @@ NAGIOS_RESULT=0
 NAGIOS_DETAILS=
 
 for DNS_ZONE in $DNS_ZONES; do
-  read AUTH_NAMESERVER <<<$(host -t soa $DNS_ZONE ${DNS_SERVERS// .*/} | tail -1 | cut -d\  -f5 | sed "s/.$//")
-  [ -n "$AUTH_NAMESERVER" ] && read AUTH_SOA_SERIAL <<<$(host -t soa $DNS_ZONE $AUTH_NAMESERVER | tail -1 | cut -d\  -f7)
+  AUTH_NAMESERVER=$(host -t soa $DNS_ZONE ${DNS_SERVERS// .*/} | tail -1 | cut -d\  -f5 | sed "s/.$//")
+  [ -n "$AUTH_NAMESERVER" ] && AUTH_SOA_SERIAL=$(host -t soa $DNS_ZONE $AUTH_NAMESERVER | tail -1 | cut -d\  -f7)
   if [ -z "$AUTH_SOA_SERIAL" ]; then
     NAGIOS_STATE=CRITICAL
     NAGIOS_RESULT=2
@@ -69,8 +69,9 @@ for DNS_ZONE in $DNS_ZONES; do
     NAMESERVER_EMPTY=
     NAMESERVERS=$DNS_SERVERS
     if [ -z "$DNS_SERVERS" -o "$DNS_SERVER_LOOKUP" == '-n' -o "$DNS_SERVERS" == "$AUTH_NAMESERVER" ]; then
-      NAMESERVERS="$NAMESERVERS $(host -t ns $DNS_ZONE $AUTH_NAMESERVER | fgrep -v : | sed "s/.* //;s/\.$//")"
+      NAMESERVERS="$NAMESERVERS $(host -t ns $DNS_ZONE $AUTH_NAMESERVER | fgrep -v : |  sed "s/.* //;s/\.$//")"
     fi
+    NAMESERVERS=$(echo $NAMESERVERS | tr ' ' '\n' | sort -u)
     for NAMESERVER in $NAMESERVERS; do
       if [ "$NAMESERVER" != "$AUTH_NAMESERVER" ]; then
         SOA_SERIAL=$(host -t soa $DNS_ZONE $NAMESERVER | tail -1 | cut -d\  -f 7)