I'd like Linux to make only one request to DNS server, wait for 5 sec timeout and then abort the lookup if no answer.
To do this I set the following options in /etc/resolv.conf
assuming that attempts
element in options
means the exact number of DNS requests:
nameserver 'DNS Server IP address'
domain 'Domain Name'
options attempts:1 timeout:5
But the system behaves unexpectedly. In fact for these settings I observe:
DNS request
Wait for a 5 sec timeout
DNS request repeat
Wait for a 5 sec timeout
If I set attempts:2, there will be 4 requests.
Do I correctly understand that '1 attempt' in fact means 'make a request and then re-request after timeout'?
Is there a way to change this behaviour so the system would send only one DNS request in scope of 1 attempt?
Thanks