Avoid repeating DNS resource records
Avoid repeating DNS resource records

When looking up resource records using the host resolver on the Mac
we often encounter situations like

  a IN CNAME b
  b IN CNAME c
  c IN CNAME d
  d IN A p.q.r.s

The initial query will often return only the CNAMEs. When we look up
the CNAMEs again we can encounter duplicates e.g.

  query(A, a) =
    a IN CNAME b
    b IN CNAME c
    c IN CNAME d

  query(A, b) =
    b IN CNAME c
    c IN CNAME d

Then if we concatenate these results together, we end up with duplicate
records.

This patch de-duplicates the list.

Signed-off-by: David Scott <63c9eb0ea83039690fefa11afe17873ba8278a56@docker.com>

djs55/vpnkit,djs55/vpnkit,djs55/vpnkit