resolv.conf 765 B

12345678910111213141516171819202122232425262728293031
  1. #!/bin/bash
  2. domain=`(. /boot.conf; echo "$DNSDOMAINNAME") 2>/dev/null`
  3. echo "# This file is automagically regenerated with each boot"
  4. echo
  5. test "$domain" && echo "domain $domain"
  6. test "$domain" && echo "search $domain"
  7. echo
  8. echo "# Note that nslookup can choke on DNS server which itself"
  9. echo "# does NOT have domain name. Other things can work fine."
  10. echo
  11. # # If we run DNS cache:
  12. # echo "nameserver 127.0.0.1"
  13. # exit
  14. prio=0
  15. i=0; while test "${if[$i]}"; do
  16. test x"${dns_prio[$i]}" != x"" \
  17. && test "${dns_prio[$i]}" -gt "$prio" \
  18. && prio="${dns_prio[$i]}"
  19. let i++; done
  20. i=0; while test "${if[$i]}"; do
  21. for d in ${dns[$i]}; do
  22. p="${dns_prio[$i]}"
  23. test x"$p" == x"" && p=0
  24. test x"$p" == x"$prio" || continue
  25. echo "nameserver $d"
  26. done
  27. let i++; done