Add a second-level domain name to the code, and automatically do a record analysis?

  linux, question

Today, others told me about the domain name resolution of shopnc secondary merchants.
I didn’t understand the way to realize it.
Is the background editor of a merchant’s secondary domain name, the domain name will automatically point to the server’s ip, ping out the address is also.
I don’t have a chance to see the code implementation now. I want to ask everyone how this is probably implemented.
Interface with a dns service provider?

Pan resolution, domain name resolution fill in*

You can enter the same ip that any secondary domain name points to.