Ad
  • Custom User Avatar

    I agree, this is not a good question right now. Without a given list of second level domains it is not possible to extract the "domain" (which is also not the correct name as pointed out by others). For example: www.museum.tt should return "www", because "mesuem.tt" is actually a SLD that can be registered (same as .co.uk). There is a npm packages that solves this problem:
    https://github.com/lupomontero/psl

    As mentioned it contains a complete list of all registerable SLD's.