But the accepted answer on SO that I copied the code that I have no idea what it does should work, right? There's no bogus accepted answers. The community would have fixed that, so it's trust worthy for me to use as is.
It gets worse. Some think the FQDN is the domain zone. Some think it's with elements you find in an URL like the protocol or a part of a path. Humans. Ugh.