maindomain is a library written by go which can help you find out the main domain from the domain name.
Main domain is the parts getting from you DNS register. For example, "www.google.com" main domain is google.com. For most cases, it is easy to find out. But in some case, it's almost not be able to do it. For example, i-123.elb.amazonaws.com.cn, the main domain is i-123.elb.amazonaws.com.cn, Crazy, isn't it.
That is why this library comes.