Use Domain Access: https://www.drupal.org/project/domain
Core Drupal + Domain Access can do this, you don't need any code or custom modules. Your Drupal can load different content on each configured domain name.
- Point all domains in Apache/Nginx at the same Drupal install directory.
- Install Drupal using your primary domain.
- Create your Landing Page nodes using the default Page Content Type.
- Install Domain Access.
- Add a new Domain at: http://example.com/admin/structure/domain/create
- Edit the Domain settings at: http://example.com/admin/structure/domain/view/:id/config and specify the Site frontpage.
- Done.
If you want it in code, you can export the entire configuration with the Features module: https://www.drupal.org/project/features