title: How to filter fqdn of x.y.c.d where x.y is random, but c.d is fixed?
body: <pre><code>p66-contacts.fe.apple-dns.net
  p39-contacts.fe.apple-dns.net
  p11-content.fe.apple-dns.net
  p54-content.fe.apple-dns.net
  p64-content.fe.apple-dns.net
  p17-content.fe.apple-dns.net
  gateway.fe.apple-dns.net
  p33-availability.fe.apple-dns.net
  p35-availability.fe.apple-dns.net
  any-applefinance-cache.internal.query.a03.yahoodns.net
  apple-weather-yql.media.g04.yahoodns.net
  vyvqg.x.incapdns.net
  stun1.webrtc.us-east-1.prod.mozaws.net
  shavar.prod.mozaws.net
  ping.chartbeat.net
  d3buumnqdlycz0.cloudfront.net
  d3ag4hukkh62yn.cloudfront.net
  dg2iu7dxxehbo.cloudfront.net
  d1kjqklgpia5go.cloudfront.net
  us-u.openx.net
  f4.shared.global.fastly.net
  online.immi.gov.au
  www.border.gov.au
  www.zamek-ceskykrumlov.eu
  ossuary.eu
  www.opera.hu
  mng.hu
  </code></pre>
  
  <p>The above are the urls example, I would like to filter out urls where the last two parts(divided by the .) are the same when the matches are greater or equal than 4, then the expected output of that filter will be the below list:</p>
  
  <pre><code>apple-dns.net
  cloudfront.net
  </code></pre>
  
  <p>but without gov.au, because it only appears twice</p>
  
  <p>sorry, let me change my request a little bit: just filter out the items when last three parts(divided by .) are in common, so <code>p17-content.fe.apple-dns.net</code> will be qualified, but <code>dg2iu7dxxehbo.cloudfront.net</code> wouldn't qualified; And I tried to use <code>| rev | cut -d '.' -f -3 | rev</code>, is that looks good? or any better suggestion?</p>