The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

I have an idea for a cool script.

Discussion in 'cPanel Developers' started by DWHS.net, Jul 22, 2005.

  1. DWHS.net

    DWHS.net Well-Known Member
    PartnerNOC

    Joined:
    Jul 28, 2002
    Messages:
    1,569
    Likes Received:
    6
    Trophy Points:
    38
    Location:
    LA, Costa RIca
    cPanel Access Level:
    Root Administrator
    :D So here is the idea:

    Make a script that scans the apache error log daily for the error:

    lame server resolving your-main-domain.com ect..

    Then when t finds one it create a a dns zone file for that domain and a specified i.p..

    Then it scp's the dns zone file to your dns servers /var/named/ directory?

    What do you guys think?

    :D

    Chaze
     
  2. DWHS.net

    DWHS.net Well-Known Member
    PartnerNOC

    Joined:
    Jul 28, 2002
    Messages:
    1,569
    Likes Received:
    6
    Trophy Points:
    38
    Location:
    LA, Costa RIca
    cPanel Access Level:
    Root Administrator
    Nobody agrees? :mad:
     
  3. gorilla

    gorilla Well-Known Member

    Joined:
    Feb 3, 2004
    Messages:
    699
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    Sydney / Australia
  4. kosmo

    kosmo Well-Known Member

    Joined:
    Aug 12, 2001
    Messages:
    403
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    All over Europe
    Wasn't she Greta Garbo?
     
  5. gorilla

    gorilla Well-Known Member

    Joined:
    Feb 3, 2004
    Messages:
    699
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    Sydney / Australia
    You know your women , that was to be expected from a greek gigolo :D
     
  6. Spiral

    Spiral BANNED

    Joined:
    Jun 24, 2005
    Messages:
    2,023
    Likes Received:
    7
    Trophy Points:
    0
    Bad idea .... creating such a script would allow ANYONE to install new zone files
    to your DNS server by simply updating their domains to use your DNS servers.

    This would of course open up a potential pandora's box of security problems.

    I do have a similiar script installed on my server as a cronjob but instead of
    blindly creating DNS zones when it detects the error message, it just simply
    sends me an email message to let me know there is a domain out there
    configured for our network that is not setup in our DNS. That way, I can
    review it and determine if it is a domain that should be legitimately added
    to our DNS servers or not.
     
  7. sawbuck

    sawbuck Well-Known Member

    Joined:
    Jan 18, 2004
    Messages:
    1,367
    Likes Received:
    5
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    Any interest in sharing it?
     
  8. rpmws

    rpmws Well-Known Member

    Joined:
    Aug 14, 2001
    Messages:
    1,824
    Likes Received:
    5
    Trophy Points:
    38
    Location:
    back woods of NC, USA
    is there a way to do wildcards with bind? have bind point normally (non) resolving domains to a particular IP? a way to catch traffic you normally would not be able to.
     
  9. Specks

    Specks Well-Known Member

    Joined:
    Jul 3, 2004
    Messages:
    68
    Likes Received:
    0
    Trophy Points:
    6
    I don't think you can create a complete wildcard zone for bind to shuck all non-resolvable domains to. I'll have to find my Bind book and see if such a domain is possible. I don't think so though.
     
  10. Spiral

    Spiral BANNED

    Joined:
    Jun 24, 2005
    Messages:
    2,023
    Likes Received:
    7
    Trophy Points:
    0
    Actually you can but what would be the point?
     
  11. DWHS.net

    DWHS.net Well-Known Member
    PartnerNOC

    Joined:
    Jul 28, 2002
    Messages:
    1,569
    Likes Received:
    6
    Trophy Points:
    38
    Location:
    LA, Costa RIca
    cPanel Access Level:
    Root Administrator
    I was thinking to capture canceled domains traffic and to have a page show that the account is no longer active.

    Also to not have lame server resolving errors.

    Not a big deal but when you have thousands of accounts the traffic can ad up and help promote your company while helping the surfer too.
     
  12. Ishware

    Ishware Well-Known Member

    Joined:
    Nov 7, 2003
    Messages:
    168
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Panama City, FL
    cPanel Access Level:
    Root Administrator
    Isn't it the case that if a request comes in that doesn't match anything in httpd.conf, that apache shows the server-wide default page? (i.e. "There is no website configured at this address")...

    Seems like you could customize that page with your desired info... *shrug*

    My apologies if this wouldn't apply to all cases. And sure, it'd only be html, but hey, it's a start. :)
     
  13. DWHS.net

    DWHS.net Well-Known Member
    PartnerNOC

    Joined:
    Jul 28, 2002
    Messages:
    1,569
    Likes Received:
    6
    Trophy Points:
    38
    Location:
    LA, Costa RIca
    cPanel Access Level:
    Root Administrator
    True but only if a dns zone exists for that domain name, this script would create the dns zone sending them to a i.p. or the default page.

    If their is no dns zone then the connection goes to a page cannot be found error.
     

Share This Page