Q:

Extract sublevel domain from a list with Fully Qualified Domain Name addresses?

Hello everyone,
Using CMD/batch i'm trying to extract sub(or second)level domains from a self compiled (.txt) document with Fully Qualified Domain Name addresses in it.
EXAMPLES
FQDN address: www.somethingfunny.com
What i want : somethingfunny.com

FQDN address: something.funny.com
What i want : funny.com

FQDN address: www.somethingfunny.co.uk
What i want : somethingfunny.co.uk

Besides having searched/looked through and having tried other people's code, i have tried to FOR /F loop/iterate through the '.' periods, and hoped i could simply do this in a reverse/backwards search order. But, the more (failed) attempts i make and the longer i think about it, the more impossible it seems to pull this off (or atleast for me).
I am very aware there are much better solutions  (scripting/programming languages) to achieve this with, but does that also mean it's impossible to do such a thing using pure cmd/batch? I'm not sure!
Lets find out...?
(i know it can be of help to post some actual code, but i'm quite certain it will look like a complete mess/joke, set aside the fact that it would also embarras me... i'm happy to learn from others, though!)

A:

This works on the command line: for /f "tokens=1,* delims=." %a in ("%_FQDN_%") do set _secondLevel_=%b. Double up on the '%' symbols in a batch file. Since you didn't bother to post an MCVE, I'll leave it to you to work out what the batch file should look like.

