Running resolvconf from script

Manish Jain bourne.identity at
Thu Jan 8 12:47:39 UTC 2015


I am on FreeBSD-10.1-i386. For some reason, DNS information on my system 
sometimes 'evaporates' and I am left with no network access. To restore 
internet, I have to execute the following sequentially (re0 is my 
ethernet card and /etc/nameservers.list is a file I created which 
contains the list of nameservers) :

ifconfig re0 down
ifconfig re0 up
resolvconf -d re0
resolvconf -a re0 < /etc/nameservers.list

While the sequence works well and restores internet, I would ideally 
like to move the commands into a Bash shell script. But executing the 
resolvconf commands from a script results in an error message "No 
resolv.conf for re0" (or something to that effect) and 'resolvconf -l 
re0' returns an empty/incomplete list, with no internet working yet.

So is there any way I can automate the work via a script ?

Thanks and Regards,

Manish Jain

More information about the freebsd-questions mailing list