Results 1 to 10 of 10

Thread: CMD_API_DNS_CONTROL / CMD_API_DNS_MX delete MX records

  1. #1
    Join Date
    Feb 2019
    Posts
    5

    CMD_API_DNS_CONTROL / CMD_API_DNS_MX delete MX records

    hello,

    I'm trying to delete an MX one record (actually i have 5), im choosing one record and make an delete:

    Array
    (
    [domain] => abecadlozmien.pl
    [action] => select
    [select0] => name=mydomain.com.&value=40%20mxrecordtest
    )

    to CMD_API_DNS_CONTROL the record is not deleted, another record is deleted (from what I noticed it is a record one above)

    The same problem i have with CMD_API_DNS_CONTROL

    Array
    (
    [domain] => abecadlozmien.pl
    [action] => select
    [mxrecs0] => name=mydomain.com.&value=40%20mxrecordtest
    )

    Another records i can delete (CNAME,A) and this work.


    Any ideas ?

  2. #2
    Join Date
    Apr 2005
    Location
    GMT +7.00
    Posts
    12,708
    Hello,


    PHP Code:
    [
         
    'domain'   => "abecadlozmien.pl",
         
    'action'   => "select",
         
    'mxrecs0'  => urlencode("name=mydomain.com.&value=40 mxrecordtest"),

    This way?

  3. #3
    Join Date
    Feb 2019
    Posts
    5
    hello,

    It still doesnt work

    My Array:

    Array
    (
    [domain] => abecadlozmien.pl
    [action] => select
    [mxrecs0] => name%3Dabecadlozmien.pl.%26value%3D10+za
    )

    real mx record - abecadlozmien.pl. value 10 za

    response from DA

    Array
    (
    [error] => 0
    [text] => Records Deleted
    [details] =>
    )

    but record is still in DNS (result ok but didnt delete anything).


    i also tried

    "mxrecs0" => "name=abecadlozmien.pl.&value=40+za"

    but this is deleting wrong record.

  4. #4
    Join Date
    Apr 2005
    Location
    GMT +7.00
    Posts
    12,708
    1. Go to directadmin page and open DNS editor for the required domain
    2. Open a HTML version of the page
    3. Find <input type hidden for the desired MX record and see what value it has there.


    In my case I have


    HTML Code:
    <input type=checkbox name=mxrecs0 value="name=test.com.&value=10 mail">
    i.e. 10 mail is transformed into 10 mail

    in php use ord() for that http://php.net/manual/en/function.ord.php

  5. #5
    Join Date
    Apr 2005
    Location
    GMT +7.00
    Posts
    12,708
    I believe the forums engine has converted originally it looks like:

    Code:
    name=domain.example.&value=&#49;&#48; mail

  6. #6
    Join Date
    Feb 2019
    Posts
    5
    Quote Originally Posted by zEitEr View Post
    I believe the forums engine has converted originally it looks like:

    Code:
    name=domain.example.&value=10 mail


    Eh. it doesnt work too:

    Code:
    Array
    (
        [domain] => domain.example
        [action] => select
        [mxrecs0] => name=domain.example.&value=&#49;&#48 mail
    )
    any other ideas ?

  7. #7
    Join Date
    Apr 2005
    Location
    GMT +7.00
    Posts
    12,708
    Did you copy the value from HTML code on your page in Directadmin or from my post on the forums? The digital 40 will be introduced by different codes. In my example it is only 10 encoded.

  8. #8
    Join Date
    Feb 2019
    Posts
    5
    Quote Originally Posted by zEitEr View Post
    Did you copy the value from HTML code on your page in Directadmin or from my post on the forums? The digital 40 will be introduced by different codes. In my example it is only 10 encoded.

    Yea, in my web browser (default DA template) i have:

    Code:
    <tr><td class=list>abecadlozmien.pl.</td><td class=list align=center>MX</td><td class=list >&#49;&#48; mail</td><td class=list align=center><input type=checkbox name=mxrecs0 value="name=abecadlozmien.pl.&value=&#49;&#48; mail"></td></tr>
    and when i put this to my value to API:
    Code:
    Array
    (
        [domain] => abecadlozmien.pl
        [action] => select
        [mxrecs0] => name=abecadlozmien.pl.&value=&#49;&#48; mail
    )
    But it doesn't work.

    Any ideas

  9. #9
    Join Date
    Apr 2005
    Location
    GMT +7.00
    Posts
    12,708
    mxrecs0 should urlencode()

  10. #10
    Join Date
    Feb 2019
    Posts
    5
    Quote Originally Posted by zEitEr View Post
    mxrecs0 should urlencode()


    Yes, i have actually urlencode mxrecs0 value but it doesn't work :<

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •