Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

set IP for creating domain or subdomain in DNS record

Discussion in 'General Discussion' started by behinam, Jan 28, 2018.

  1. behinam

    behinam Member

    Joined:
    May 9, 2017
    Messages:
    21
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Dubay
    cPanel Access Level:
    Root Administrator
    Hello
    i have Cpanel server with IP : X.X.X.X
    when i create a account or subdomain, it was created with Cpanel ip in DNS A records, but i want when i create new domain or account , it create with my arbitrary A record IP like X.X.X.Y in DNS records. ( domain point to my IP)

    my webserver Isolated from Cpanel server and website should point to webserver IP.

    Can anyone help?
     
  2. 24x7server

    24x7server Well-Known Member

    Joined:
    Apr 17, 2013
    Messages:
    1,792
    Likes Received:
    83
    Trophy Points:
    78
    Location:
    India
    cPanel Access Level:
    Root Administrator
    Hi,

    Check what IP address is set to default in the WHM basic configuration section. This will be the one that will be used when a new account is created..
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. behinam

    behinam Member

    Joined:
    May 9, 2017
    Messages:
    21
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Dubay
    cPanel Access Level:
    Root Administrator
    Hello
    Cpanel IP address set in basic configuration WHM but web servers IP is different. I want when create Sub domain, it create with webserver A record in DNS service instead of Cpanel IP address.

    thanks
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    43,711
    Likes Received:
    1,794
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. behinam

    behinam Member

    Joined:
    May 9, 2017
    Messages:
    21
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Dubay
    cPanel Access Level:
    Root Administrator
    Hello
    thanks for answer.
    this template dost have an entry for subdomain.
    how can i add custom line for every new subdomains?
     
  6. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    43,711
    Likes Received:
    1,794
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    You could develop a custom bash script that manually modifies or adds to the DNS zone through the manipulation of the corresponding zone file in the /var/named/ directory. Then, configure that custom script to automatically run upon the creation of new subdomains via a hook event:

    Guide to Standardized Hooks - Software Development Kit - cPanel Documentation

    You can find the corresponding API function for a hook by enabling "Debug mode is on. The system displays information about every stage for every hookable event, even if no hooks exist for that stage." under the "Development" tab in "WHM >> Tweak Settings". Then, perform the specific action you want to hook into via cPanel or WHM, and watch the output in /usr/local/cpanel/logs/error_log.

    For example, the following cPanel API 1 function is utilized when adding an Alias in cPanel:

    Cpanel::Api1::Park::park

    You can find documentation on hooks with cPanel functions at:

    Guide to Standardized Hooks - Cpanel Functions - Software Development Kit - cPanel Documentation

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice