Why DNS query returns NS records in a random order? Is it possible to impose strict ordering for the name servers?

Most name server implementations do not provide or support strict ordering of NS records. This is due to the fact that the domain system was designed with the assumption that all NS records listed for a zone give the same answer for a given query in that zone. Fortunately, the domain system achieves load-balancing and failover between name servers (NS'es) automatically. This is because that most well-known name resolver implementations (e.g., BIND) keep track of how quickly name servers answer, and will prefer faster name servers over slower ones. Thus, no need to impose a strict ordering on NS records for performance or capacity reasons. For that reason, strict ordering of NS records is not implemented by the domain system. For further reading, please see: RFC 1033: DOMAIN ADMINISTRATORS OPERATIONS GUIDE http://www.faqs.org/rfcs/rfc1033.html.