Problems adding MX zone record via SOAP

Started by dannor, January 12, 2006, 08:41:38 AM

Previous topic - Next topic

dannor

We are automating the creation of zones in our system. We are using NicTool v 2.03.

We can create MX records using NicToolClient, but the same input parameters will not work using NicToolAPI.

We are trying to do the following using NicToolAPI:

* Create a new zone.
* Add our standard MX:es to the new zone.

For the purpose of explaining, lets use the domain "domain.com".

When adding an MX record we're using the SOAP command new_zone_record

The parameter we are having trouble with is the "name" parameter.

When setting the MX for the entire domain using nictool-client the name parameter is set to

domain.com.

Note the trailing dot.

If the name parameter is set to "domain.com." using the SOAP command new_zone_record the following error message will occur:

sanity_err => {name=1}
error_code => 300
sanity_msg => [absolute host names are NOT allowed. Remove the dot and the host will automatically live within the current zone.]
error_msg => absolute host names are NOT allowed. Remove the dot and the host will automatically live within the current zone.
error_desc => Sanity error

Leaving the name parameter empty does not work either, then it will complain on missing parameter as follows:

error_code => 301
error_msg => name
error_desc => Required parameters missing

From what I can see, it's not possible to add default MX records to the zone using SOAP, but exactly the same input works in NicToolClient. Is this a bug and is there a way around it?

We have no problems adding MX for ie sales.domain.com because then we just set the name parameter to "sales".

We would be very happy for some light on this issue Smile

dannor

The answer to the question is to set the name field to "@" (excluding the quotation marks).

I found it out by studying the source code of package NicToolServer::Zone::Record::Sanity

I think this is quite relevant and should be added to the online manual.