November 23, 2017
# Create Resource Record.
# This script creates a new domain resource record.
# Important manual pages:
# @see
# @license <>
# @author SoftLayer Technologies, Inc. <>
use lib '/path/to/SoftLayer/';
use Data::Dumper;
use SoftLayer::API::SOAP;
use strict;

# Set your SoftLayer API username and key.
my $api_username = 'set me';
my $api_key = 'set me';

# Set the domain id that you want to add a new record.
my $dns_id = 1880851;

# Service to use to create a new record.
my $resource_record_service ='SoftLayer_Dns_Domain_ResourceRecord';

# Creating a template to configure our DNS Zone edition.
my $object_template = {
	'domainId'=>  $dns_id,
	'data'=> '',
	'host'=> '@',
	'type'=> 'a'
# Create a Resource record client to the API service.
my $resource_record_client = SoftLayer::API::SOAP->new($resource_record_service, undef, $api_username, $api_key);

my $result = $resource_record_client->createObject($object_template);
if ($result->fault) {
	die 'There is an error when trying to add a new resource record...' . $result->faultstring;
} else {
	print Dumper($result);


If this article contains any error, or leaves any of your questions unanswered, please help us out by opening up a github issue.
Open an issue