cleanbrowsing / dnsperftest

DNS Performance test
Other
2.33k stars 279 forks source link

does not work if `resolv.conf` uses tabs instead of spaces #85

Open telnetdoogie opened 11 months ago

telnetdoogie commented 11 months ago

Running this script on synology out-of-the-box incorrectly gathers invalid nameservers for the host.

cat /etc/resolv.conf | grep ^nameserver | cut -d " " -f 2 | sed 's/\(.*\)/&#&/'
nameserver  192.168.1.1#nameserver  192.168.1.1

...this is resolved by adding cut -f 2 (which uses the default tab delimiter for cut) and it also continues to work on other OSes where the space is used. I'll create a PR for this change.