The freebsd-update script tries to find mirrors using SRV records. My Mikrotik router with built-in nameserver gives the following output: # host -t srv _http._tcp.update.FreeBSD.org _http._tcp.update.freebsd.org has SRV record 1 35 80 update4.FreeBSD.org. _http._tcp.update.freebsd.org has SRV record 1 50 80 update5.FreeBSD.org. _http._tcp.update.freebsd.org has SRV record 1 5 80 update3.FreeBSD.org. The first part is converted to lowercase. The freebsd-update script checks (with sed) for "_http._tcp.update.FreeBSD.org", but that does not match the lowercase output. freebsd-update is unable to find the mirrors, and freebsd-update fails. The workaround for this problem is to change the Servername in /etc/freebsd-update.conf to all lowercase. Fix: Make the regular expression - used to strip away the "_http._tcp.update.freebsd.org has SRV record " - case insensitive: Change: sed -nE "s/${MLIST} (has SRV record|server selection) //p" to sed -nE "s/${MLIST} (has SRV record|server selection) //Ip" How-To-Repeat: Use a mikrotik router as nameserver or any other nameserver that returns the requested hostname in lowercase instead of the original casing.
Responsible Changed From-To: freebsd-bugs->cperciva Over to maintainer.
I'm also seeing this on 10.1-Release with BIND 9 as my DNS server. $ host -t srv _http._tcp.update.FreeBSD.org _http._tcp.update.FreeBSD.org has SRV record 1 30 80 update2.freebsd.org. _http._tcp.update.FreeBSD.org has SRV record 1 40 80 update6.freebsd.org. _http._tcp.update.FreeBSD.org has SRV record 1 5 80 update3.freebsd.org. _http._tcp.update.FreeBSD.org has SRV record 1 35 80 update4.freebsd.org. _http._tcp.update.FreeBSD.org has SRV record 1 50 80 update5.freebsd.org. $ host -t srv _http._tcp.update.FreeBSD.org | sed -nE "s/_http._tcp.update.FreeBSD.org (has SRV record|server selection) //p" $ host -t srv _http._tcp.update.FreeBSD.org | sed -nE "s/_http._tcp.update.FreeBSD.org (has SRV record|server selection) //pi" 1 50 80 update5.freebsd.org. 1 35 80 update4.freebsd.org. 1 40 80 update6.freebsd.org. 1 30 80 update2.freebsd.org. 1 5 80 update3.freebsd.org.
Joseph: I must be blind... looks to me like that `host` output should be matched even with case sensitivity?
*** Bug 197047 has been marked as a duplicate of this bug. ***
(In reply to Colin Percival from comment #3) bind cache's only the first result's case to save space, so subsequent requests that require case sensitivity in post-processing will potentially fail. To work around this issue, I had to add "no-case-compress { any; };" to my options section in named.conf.
The bug is still there in 11.0-RELEASE Silly enough the very same code is implemented properly in portsnap. Compare fetch_pick_server_init() functions in portsnap and freebsd-update. The only difference is capital 'i' option in sed expression which is missing from freebsd-update and triggering this bug for ages.
A commit references this bug: Author: cperciva Date: Wed Oct 12 20:24:33 UTC 2016 New revision: 307156 URL: https://svnweb.freebsd.org/changeset/base/307156 Log: MFportsnap r264740: Use case insensitive match when parsing host(1) output. Some DNS caches turn "FreeBSD.org" into "freebsd.org", which was causing the printed SRV records to not match our regex. PR: 170503 MFC after: 2 weeks Changes: head/usr.sbin/freebsd-update/freebsd-update.sh
(In reply to John Michael from comment #5) Aha! Thanks for pointing out the dns cache mangling... I couldn't figure out how this was happening (or to reproduce it myself, given that I don't use that particular cache). Should be fixed now, will MFC in a couple weeks.
*** Bug 213411 has been marked as a duplicate of this bug. ***
A commit references this bug: Author: eadler Date: Sun Mar 4 08:00:07 UTC 2018 New revision: 330373 URL: https://svnweb.freebsd.org/changeset/base/330373 Log: MFC r307156: MFportsnap r264740: Use case insensitive match when parsing host(1) output. Some DNS caches turn "FreeBSD.org" into "freebsd.org", which was causing the printed SRV records to not match our regex. PR: 170503 Changes: _U stable/11/ stable/11/usr.sbin/freebsd-update/freebsd-update.sh