timeout:n
sets the amount of time the resolver will wait for a response from a remote name server before retrying the query via a different name server. Measured in seconds, the default is RES_TIMEOUT (currently 5, see <resolv.h>). The value for this option is silently capped to 30.
attempts:n
sets the number of times the resolver will send a query to its name servers before giving up and returning an error to the calling application. The default is RES_DFLRETRY (currently 2, see <resolv.h>). The value for this option is silently capped to 5.
rotate
sets RES_ROTATE in _res.options, which causes round robin selection of nameservers from among those listed. This has the effect of spreading the query load among all listed servers, rather than having all clients try the first listed server first every time.
rotate是偽隨機,經常會固定使用某個nameserver,不一定是第一個
Root Cause
The reason why RES_ROTATE related code picks up the second nameserver every time as the first one is that the item rotation of nameserver list happens before contacting any of the nameservers, thus the second nameserver goes as first every time.
https://access.redhat.com/solutions/1426263