Go to menu Settings -> Fields -> Fields Extraction, click New and create your field extraction there. You should associate it to the sourcetype or source. Give it a name and use the same Regex there. Don't forget to set the permissions right, normally I use Scope: "App" and "Read" to everyone.
This will get you the domain. I can't help with the DNS lookup.
... | rex field=URL "https?:\/\/(?<domain>[^/]+)" | ...
I have a regex for extraction, but I would like to automate the process.