nameserver 192.168.1.1 #for internal hostsSo, linux resolver tries the first nameserver. If the nameserver responds quickly it doesn’t try the second one. It ONLY tries the second one if the first times out. So if i try with this configuration to resolve internet hosts, it fails. Because it only tries the first nameserver, it replies in 1 ms so if i ask for yahoo.com, it tells me “unknown host”. Great. If i switch them, then it will only resolve internet hosts, but no internal ones.
nameserver 18.104.22.168 #for external hosts
After googling around, i found out that you can balance dns queries between resolv.conf entries. So, there’s a big chance that it will rotate just the way you need. So, to make it rotate, just add options rotate on the first line of resolv.conf, before other nameserver lines, it will then work beautifully.