code: def get_mx_records(domain):
          
  
          DNS.DiscoverNameServers()
          request = DNS.Request()
          response = request.req(name=domain, qtype=DNS.Type.MX)
  
          mx_records = []
          for answer in response.answers:
              mx_records.append(MXRecord(priority=answer['data'][0], exchange=answer['data'][1], domain=domain))
  
          return sorted(mx_records, key=lambda record: record.priority)
docs: Gets an array of MXRecords associated to the domain specified.
  
          :param domain:
          :return: [MXRecord]