sort items in endpoint selection
update library path
fixed dns lookup logic for dual-stack endpoints