DNS wildcards for named.conf and Apache are working (almost)

  • camperjohn
  • Guru
  • Guru
  • User avatar
  • Posts: 1127
  • Loc: San Diego

Post 3+ Months Ago

Preliminary: hosting-forum/optimizing-httpd-conf-fpr-parked-domains-t101793.html

I have about 4000 domains, and wanted to make a generic DNS and Apache configuration that will take ANY domain and park it without having to make an account and park it in Cpanel. This way, any idle domains I have can show ads and content (like godaddy does or any parking service does for that matter)

I have it working too...almost!

1) The configuration allows me to have any domain show a parking page, even if that domain doesn't have an account. This is working fine.
2) Strangely, this new configuration disables the file_get_contents function and the curl function(s).

Does anyone have ideas on why file_get_contents would stop working? How do I fix it so I can still park domains, and still have the file_get_contents function working?

Here is the addition to my named.conf file:
Code: [ Select ]
named.conf:

zone "." {
    type master;
    file "/var/named/parking.db";
};
  1. named.conf:
  2. zone "." {
  3.     type master;
  4.     file "/var/named/parking.db";
  5. };


The associated /var/named/parking.db database file:
Code: [ Select ]
/var/named/parking.db:

$TTL  604800
@   86400  IN   SOA   ns1.ryd0.com. john.mccarthy.net. (
               1     ; Serial
             604800     ; Refresh
             86400     ; Retry
            2419200     ; Expire
             604800 )    ; Negative Cache TTL

    IN   NS   .
*.   IN   A    204.15.192.194

;@   86400  IN   SOA   ns1.ryd0.com. john.mccarthy.net. (
  1. /var/named/parking.db:
  2. $TTL  604800
  3. @   86400  IN   SOA   ns1.ryd0.com. john.mccarthy.net. (
  4.                1     ; Serial
  5.              604800     ; Refresh
  6.              86400     ; Retry
  7.             2419200     ; Expire
  8.              604800 )    ; Negative Cache TTL
  9.     IN   NS   .
  10. *.   IN   A    204.15.192.194
  11. ;@   86400  IN   SOA   ns1.ryd0.com. john.mccarthy.net. (


And the additions to my httpd.conf file
Code: [ Select ]
<VirtualHost 204.15.192.194:80>
  ServerAlias *
  DocumentRoot /home/photof/public_html

  ...more stuff deleted...
</VirtualHost>
  1. <VirtualHost 204.15.192.194:80>
  2.   ServerAlias *
  3.   DocumentRoot /home/photof/public_html
  4.   ...more stuff deleted...
  5. </VirtualHost>


Not only does this park domain.com, but it also parks http://www.domain.com, or whatever.domain.com etc etc...

Again, this is working, but it seems to disable file_get_contents. Ideas anyone?
Moderator Remark: added preliminary
  • camperjohn
  • Guru
  • Guru
  • User avatar
  • Posts: 1127
  • Loc: San Diego

Post 3+ Months Ago

Solved!

Changed the resolve file to not point to my own server for DNS resloving for outgoing connections

Code: [ Select ]
#Use Google public DNS lookups for host resolving
#http://www.ozzu.com/google-forum/google-public-dns-t101286.html
nameserver 8.8.8.8
nameserver 8.8.4.4
#nameserver 204.15.192.194
#search prioritycolo.com
#nameserver 204.11.18.2
#nameserver 204.15.192.2
  1. #Use Google public DNS lookups for host resolving
  2. #http://www.ozzu.com/google-forum/google-public-dns-t101286.html
  3. nameserver 8.8.8.8
  4. nameserver 8.8.4.4
  5. #nameserver 204.15.192.194
  6. #search prioritycolo.com
  7. #nameserver 204.11.18.2
  8. #nameserver 204.15.192.2


Now, the catch-all zone "." doesn't catch outgoing resolves.
Moderator Remark: Added [code] tags; added Google DNS link

Post Information

  • Total Posts in this topic: 2 posts
  • Users browsing this forum: No registered users and 7 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.