Page 1 of 2 12 LastLast
Results 1 to 15 of 16

Thread: I want to add an A record to a domain [PHP]

  1. #1
    Registered Member
    Join Date
    Nov 2008
    Posts
    6

    Default I want to add an A record to a domain [PHP]

    Hello all,

    Please tell me how do i add A record to a domain and enter ip and hostname.

    I am willing to use php.

    Thanks

  2. #2
    Technical Product Specialist cPanelDavidG's Avatar
    Join Date
    Nov 2006
    Location
    Houston, TX
    Posts
    11,296
    cPanel/WHM Access Level

    Root Administrator

    Default

    Quote Originally Posted by gamesguru View Post
    Hello all,

    Please tell me how do i add A record to a domain and enter ip and hostname.

    I am willing to use php.

    Thanks
    cPanel/WHM automatically creates all the dns records needed to host a website. Is there any particular reason you are looking to do this?

  3. #3
    Registered Member
    Join Date
    Nov 2008
    Posts
    6

    Default

    Quote Originally Posted by cPanelDavidG View Post
    cPanel/WHM automatically creates all the dns records needed to host a website. Is there any particular reason you are looking to do this?
    Hi,

    I just want to add A record of a hostname like sub.domain.com => 85.203.165.XXX

    Something like this.

    I think add dns command in xml api0 will work out but it creates a new dns zone i want to add A record in existing dns zone.

    Thanks

  4. #4
    Technical Product Specialist cPanelDavidG's Avatar
    Join Date
    Nov 2006
    Location
    Houston, TX
    Posts
    11,296
    cPanel/WHM Access Level

    Root Administrator

    Default

    Quote Originally Posted by gamesguru View Post
    Hi,

    I just want to add A record of a hostname like sub.domain.com => 85.203.165.XXX

    Something like this.

    I think add dns command in xml api0 will work out but it creates a new dns zone i want to add A record in existing dns zone.

    Thanks
    Is this subdomain being hosted by that cPanel/WHM server or another server?

  5. #5
    Registered User
    Join Date
    May 2009
    Posts
    4

    Default

    I'm trying to create a script in PHP that it add a desired subdomain name (A record or web forward) into the DNS, hosted on the same server with unlimited number of subdomain allowed by the host.
    What are the php commands to do it? I have access to WHM of the host.
    Thanks.

  6. #6
    Technical Product Specialist cPanelDavidG's Avatar
    Join Date
    Nov 2006
    Location
    Houston, TX
    Posts
    11,296
    cPanel/WHM Access Level

    Root Administrator

    Default

    Quote Originally Posted by yong1986 View Post
    I'm trying to create a script in PHP that it add a desired subdomain name (A record or web forward) into the DNS, hosted on the same server with unlimited number of subdomain allowed by the host.
    What are the php commands to do it? I have access to WHM of the host.
    Thanks.
    Please elaborate, are you looking to create a subdomain, a subdomain that is redirected somewhere else, a parked domain (called domain or web forwarders in other environments) or a DNS A record?

    When you create subdomains in a cPanel/WHM environment, any required DNS records are automatically generated.

  7. #7
    Registered User
    Join Date
    May 2009
    Posts
    4

    Default

    I'm trying to create an A record, which point to an IP address, and the target server will automatically get to the directory of the server, corresponding to the subdomain used.
    In short, I'm giving a free subdomain service to the user, with the script running in PHP.
    Thanks.

  8. #8
    Technical Product Specialist cPanelDavidG's Avatar
    Join Date
    Nov 2006
    Location
    Houston, TX
    Posts
    11,296
    cPanel/WHM Access Level

    Root Administrator

    Default

    Quote Originally Posted by yong1986 View Post
    I'm trying to create an A record, which point to an IP address, and the target server will automatically get to the directory of the server, corresponding to the subdomain used.
    In short, I'm giving a free subdomain service to the user, with the script running in PHP.
    Thanks.
    To clarify, the target server is a remote server?

  9. #9
    Registered User
    Join Date
    May 2009
    Posts
    4

    Default

    Yes, it is a server with different IP, which the adding of A record intended to point to.

  10. #10
    Registered User
    Join Date
    May 2009
    Posts
    4

    Default

    So is there a way to put the command in PHP to add an A record to the DNS list?
    Thanks.

  11. #11
    Technical Product Specialist cPanelDavidG's Avatar
    Join Date
    Nov 2006
    Location
    Houston, TX
    Posts
    11,296
    cPanel/WHM Access Level

    Root Administrator

    Default

    Quote Originally Posted by yong1986 View Post
    So is there a way to put the command in PHP to add an A record to the DNS list?
    Thanks.
    Not yet, but we'll be implementing that in 11.25.

  12. #12
    Registered Member
    Join Date
    Aug 2008
    Posts
    9

    Default

    You have got to be kidding me. If Cpanel a cpanel hoster is hosting your DNS you cannot add custom DNS records? What if you have a real business and need to add dns for other reasons than your web hosting and e-mail. I have domains with 20-30 a records.

  13. #13
    Registered Member MattDees's Avatar
    Join Date
    Apr 2005
    Location
    Houston, TX
    Posts
    409

    Default

    Miahac,
    david is correct, this was previously unavailable, however it will be included in 11.25 which will go to release soon. This can be done via the API2 calls in the DNS module OR it can be done via the XML-API's addzonerecord call.
    Matt Dees

  14. #14
    Registered User
    Join Date
    May 2010
    Posts
    2

    Question Please elaborate...

    Quote Originally Posted by cPanelMatt View Post
    Miahac,
    david is correct, this was previously unavailable, however it will be included in 11.25 which will go to release soon. This can be done via the API2 calls in the DNS module OR it can be done via the XML-API's addzonerecord call.
    Could you please give me an example of the API2 calls or the XML-API addzonerecord call? Or just a link to some good info on it? I am trying to set up a new client on our server, and he wants to keep his current mail provider. Their instructions say to create an A record to their ip where the mx records are, but I cannot find a way to add an A record either. I am currently updating my WHM/Cpanel as it was at cPanel 11.24.5-R38506 - WHM 11.24.2 - X 3.9 in hopes that it will update to 11.25... Any help is greatly appreciated.

  15. #15
    Integration Developer cPanelDavidN's Avatar
    Join Date
    Dec 2009
    Location
    Houston, TX
    Posts
    570

    Default

    Hi Daledo,

    I don't have an 11.24.5 install handy to confirm that it's identical, but in 11.25.0 you can select MX Entry in the Mail section of the cPanel interface. Here, you'd select Remote Mail Exchanger and click Change. Then add the new record (that points to the previous mail provider). However, this should be a Full Qualified Domain Name, and not an IP.

    I fail to see how an A record will push inbound mail for the domain to the previous mail provider. You'll need to create an MX record.

    If you still need to use XML-API/API2, I'd be glad to help. But if you're just adding this record for a single client, the standard cPanel UI should do the trick.

    Regards,
    -David
    David Neimeyer
    Integration Developer

    sdk.cpanel.net
    APIs: XML-API API1 & API2
    Check Out: Developer Downloads Integration Blog
    Need Support? Support Ticket Developer Forum Feature Requests

Page 1 of 2 12 LastLast

Similar Threads

  1. Help getting to Add a new Addon domain via PHP
    By alexmichaelis in forum cPanel Developers
    Replies: 2
    Last Post: 04-17-2011, 07:40 PM
  2. How to add this A Record - Help
    By ricoche in forum cPanel & WHM Discussions
    Replies: 2
    Last Post: 04-01-2008, 05:55 PM
  3. MX Record has propogated for an add-on domain
    By t9clkclnr in forum cPanel & WHM Discussions
    Replies: 10
    Last Post: 07-13-2005, 02:17 PM
  4. No Domain Names seem to work & Host Name A Record Wont Add
    By chrisbuk in forum cPanel & WHM Discussions
    Replies: 0
    Last Post: 09-04-2004, 01:24 AM
  5. Add an "A" record to server.domain.com?
    By ThunderHostingDotCom in forum cPanel & WHM Discussions
    Replies: 2
    Last Post: 05-06-2004, 05:51 PM
bargain