1. Packages
  2. DNSimple Provider
  3. API Docs
  4. ZoneRecord
DNSimple v5.0.0 published on Tuesday, Dec 30, 2025 by Pulumi
dnsimple logo
DNSimple v5.0.0 published on Tuesday, Dec 30, 2025 by Pulumi

    Provides a DNSimple zone record resource.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as dnsimple from "@pulumi/dnsimple";
    
    // Add a record to the root domain
    const apex = new dnsimple.ZoneRecord("apex", {
        zoneName: "example.com",
        name: "",
        value: "192.0.2.1",
        type: "A",
        ttl: 3600,
    });
    // Add a record to a subdomain
    const www = new dnsimple.ZoneRecord("www", {
        zoneName: "example.com",
        name: "www",
        value: "192.0.2.1",
        type: "A",
        ttl: 3600,
    });
    // Add an MX record
    const mx = new dnsimple.ZoneRecord("mx", {
        zoneName: "example.com",
        name: "",
        value: "mail.example.com",
        type: "MX",
        priority: 10,
        ttl: 3600,
    });
    
    import pulumi
    import pulumi_dnsimple as dnsimple
    
    # Add a record to the root domain
    apex = dnsimple.ZoneRecord("apex",
        zone_name="example.com",
        name="",
        value="192.0.2.1",
        type="A",
        ttl=3600)
    # Add a record to a subdomain
    www = dnsimple.ZoneRecord("www",
        zone_name="example.com",
        name="www",
        value="192.0.2.1",
        type="A",
        ttl=3600)
    # Add an MX record
    mx = dnsimple.ZoneRecord("mx",
        zone_name="example.com",
        name="",
        value="mail.example.com",
        type="MX",
        priority=10,
        ttl=3600)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-dnsimple/sdk/v5/go/dnsimple"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		// Add a record to the root domain
    		_, err := dnsimple.NewZoneRecord(ctx, "apex", &dnsimple.ZoneRecordArgs{
    			ZoneName: pulumi.String("example.com"),
    			Name:     pulumi.String(""),
    			Value:    pulumi.String("192.0.2.1"),
    			Type:     pulumi.String("A"),
    			Ttl:      pulumi.Int(3600),
    		})
    		if err != nil {
    			return err
    		}
    		// Add a record to a subdomain
    		_, err = dnsimple.NewZoneRecord(ctx, "www", &dnsimple.ZoneRecordArgs{
    			ZoneName: pulumi.String("example.com"),
    			Name:     pulumi.String("www"),
    			Value:    pulumi.String("192.0.2.1"),
    			Type:     pulumi.String("A"),
    			Ttl:      pulumi.Int(3600),
    		})
    		if err != nil {
    			return err
    		}
    		// Add an MX record
    		_, err = dnsimple.NewZoneRecord(ctx, "mx", &dnsimple.ZoneRecordArgs{
    			ZoneName: pulumi.String("example.com"),
    			Name:     pulumi.String(""),
    			Value:    pulumi.String("mail.example.com"),
    			Type:     pulumi.String("MX"),
    			Priority: pulumi.Int(10),
    			Ttl:      pulumi.Int(3600),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using DNSimple = Pulumi.DNSimple;
    
    return await Deployment.RunAsync(() => 
    {
        // Add a record to the root domain
        var apex = new DNSimple.ZoneRecord("apex", new()
        {
            ZoneName = "example.com",
            Name = "",
            Value = "192.0.2.1",
            Type = "A",
            Ttl = 3600,
        });
    
        // Add a record to a subdomain
        var www = new DNSimple.ZoneRecord("www", new()
        {
            ZoneName = "example.com",
            Name = "www",
            Value = "192.0.2.1",
            Type = "A",
            Ttl = 3600,
        });
    
        // Add an MX record
        var mx = new DNSimple.ZoneRecord("mx", new()
        {
            ZoneName = "example.com",
            Name = "",
            Value = "mail.example.com",
            Type = "MX",
            Priority = 10,
            Ttl = 3600,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.dnsimple.ZoneRecord;
    import com.pulumi.dnsimple.ZoneRecordArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            // Add a record to the root domain
            var apex = new ZoneRecord("apex", ZoneRecordArgs.builder()
                .zoneName("example.com")
                .name("")
                .value("192.0.2.1")
                .type("A")
                .ttl(3600)
                .build());
    
            // Add a record to a subdomain
            var www = new ZoneRecord("www", ZoneRecordArgs.builder()
                .zoneName("example.com")
                .name("www")
                .value("192.0.2.1")
                .type("A")
                .ttl(3600)
                .build());
    
            // Add an MX record
            var mx = new ZoneRecord("mx", ZoneRecordArgs.builder()
                .zoneName("example.com")
                .name("")
                .value("mail.example.com")
                .type("MX")
                .priority(10)
                .ttl(3600)
                .build());
    
        }
    }
    
    resources:
      # Add a record to the root domain
      apex:
        type: dnsimple:ZoneRecord
        properties:
          zoneName: example.com
          name: ""
          value: 192.0.2.1
          type: A
          ttl: 3600
      # Add a record to a subdomain
      www:
        type: dnsimple:ZoneRecord
        properties:
          zoneName: example.com
          name: www
          value: 192.0.2.1
          type: A
          ttl: 3600
      # Add an MX record
      mx:
        type: dnsimple:ZoneRecord
        properties:
          zoneName: example.com
          name: ""
          value: mail.example.com
          type: MX
          priority: 10
          ttl: 3600
    

    Create ZoneRecord Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new ZoneRecord(name: string, args: ZoneRecordArgs, opts?: CustomResourceOptions);
    @overload
    def ZoneRecord(resource_name: str,
                   args: ZoneRecordArgs,
                   opts: Optional[ResourceOptions] = None)
    
    @overload
    def ZoneRecord(resource_name: str,
                   opts: Optional[ResourceOptions] = None,
                   name: Optional[str] = None,
                   type: Optional[str] = None,
                   value: Optional[str] = None,
                   zone_name: Optional[str] = None,
                   priority: Optional[int] = None,
                   regions: Optional[Sequence[str]] = None,
                   ttl: Optional[int] = None)
    func NewZoneRecord(ctx *Context, name string, args ZoneRecordArgs, opts ...ResourceOption) (*ZoneRecord, error)
    public ZoneRecord(string name, ZoneRecordArgs args, CustomResourceOptions? opts = null)
    public ZoneRecord(String name, ZoneRecordArgs args)
    public ZoneRecord(String name, ZoneRecordArgs args, CustomResourceOptions options)
    
    type: dnsimple:ZoneRecord
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args ZoneRecordArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args ZoneRecordArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args ZoneRecordArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ZoneRecordArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args ZoneRecordArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var zoneRecordResource = new DNSimple.ZoneRecord("zoneRecordResource", new()
    {
        Name = "string",
        Type = "string",
        Value = "string",
        ZoneName = "string",
        Priority = 0,
        Regions = new[]
        {
            "string",
        },
        Ttl = 0,
    });
    
    example, err := dnsimple.NewZoneRecord(ctx, "zoneRecordResource", &dnsimple.ZoneRecordArgs{
    	Name:     pulumi.String("string"),
    	Type:     pulumi.String("string"),
    	Value:    pulumi.String("string"),
    	ZoneName: pulumi.String("string"),
    	Priority: pulumi.Int(0),
    	Regions: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	Ttl: pulumi.Int(0),
    })
    
    var zoneRecordResource = new ZoneRecord("zoneRecordResource", ZoneRecordArgs.builder()
        .name("string")
        .type("string")
        .value("string")
        .zoneName("string")
        .priority(0)
        .regions("string")
        .ttl(0)
        .build());
    
    zone_record_resource = dnsimple.ZoneRecord("zoneRecordResource",
        name="string",
        type="string",
        value="string",
        zone_name="string",
        priority=0,
        regions=["string"],
        ttl=0)
    
    const zoneRecordResource = new dnsimple.ZoneRecord("zoneRecordResource", {
        name: "string",
        type: "string",
        value: "string",
        zoneName: "string",
        priority: 0,
        regions: ["string"],
        ttl: 0,
    });
    
    type: dnsimple:ZoneRecord
    properties:
        name: string
        priority: 0
        regions:
            - string
        ttl: 0
        type: string
        value: string
        zoneName: string
    

    ZoneRecord Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The ZoneRecord resource accepts the following input properties:

    Name string
    The name of the record. Use "" for the root domain.
    Type string
    The type of the record (e.g., A, AAAA, CNAME, MX, TXT). The record type must be specified in UPPERCASE.
    Value string
    The value of the record.
    ZoneName string
    The zone name to add the record to.
    Priority int
    The priority of the record. Only used for certain record types (e.g., MX, SRV).
    Regions List<string>
    A list of regions to serve the record from. You can find a list of supported values in our developer documentation.
    Ttl int
    The TTL of the record. Defaults to 3600.
    Name string
    The name of the record. Use "" for the root domain.
    Type string
    The type of the record (e.g., A, AAAA, CNAME, MX, TXT). The record type must be specified in UPPERCASE.
    Value string
    The value of the record.
    ZoneName string
    The zone name to add the record to.
    Priority int
    The priority of the record. Only used for certain record types (e.g., MX, SRV).
    Regions []string
    A list of regions to serve the record from. You can find a list of supported values in our developer documentation.
    Ttl int
    The TTL of the record. Defaults to 3600.
    name String
    The name of the record. Use "" for the root domain.
    type String
    The type of the record (e.g., A, AAAA, CNAME, MX, TXT). The record type must be specified in UPPERCASE.
    value String
    The value of the record.
    zoneName String
    The zone name to add the record to.
    priority Integer
    The priority of the record. Only used for certain record types (e.g., MX, SRV).
    regions List<String>
    A list of regions to serve the record from. You can find a list of supported values in our developer documentation.
    ttl Integer
    The TTL of the record. Defaults to 3600.
    name string
    The name of the record. Use "" for the root domain.
    type string
    The type of the record (e.g., A, AAAA, CNAME, MX, TXT). The record type must be specified in UPPERCASE.
    value string
    The value of the record.
    zoneName string
    The zone name to add the record to.
    priority number
    The priority of the record. Only used for certain record types (e.g., MX, SRV).
    regions string[]
    A list of regions to serve the record from. You can find a list of supported values in our developer documentation.
    ttl number
    The TTL of the record. Defaults to 3600.
    name str
    The name of the record. Use "" for the root domain.
    type str
    The type of the record (e.g., A, AAAA, CNAME, MX, TXT). The record type must be specified in UPPERCASE.
    value str
    The value of the record.
    zone_name str
    The zone name to add the record to.
    priority int
    The priority of the record. Only used for certain record types (e.g., MX, SRV).
    regions Sequence[str]
    A list of regions to serve the record from. You can find a list of supported values in our developer documentation.
    ttl int
    The TTL of the record. Defaults to 3600.
    name String
    The name of the record. Use "" for the root domain.
    type String
    The type of the record (e.g., A, AAAA, CNAME, MX, TXT). The record type must be specified in UPPERCASE.
    value String
    The value of the record.
    zoneName String
    The zone name to add the record to.
    priority Number
    The priority of the record. Only used for certain record types (e.g., MX, SRV).
    regions List<String>
    A list of regions to serve the record from. You can find a list of supported values in our developer documentation.
    ttl Number
    The TTL of the record. Defaults to 3600.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the ZoneRecord resource produces the following output properties:

    Id string
    The provider-assigned unique ID for this managed resource.
    NameNormalized string
    QualifiedName string
    The fully qualified domain name (FQDN) of the record.
    ValueNormalized string
    The normalized value of the record.
    ZoneId string
    The zone ID of the record.
    Id string
    The provider-assigned unique ID for this managed resource.
    NameNormalized string
    QualifiedName string
    The fully qualified domain name (FQDN) of the record.
    ValueNormalized string
    The normalized value of the record.
    ZoneId string
    The zone ID of the record.
    id String
    The provider-assigned unique ID for this managed resource.
    nameNormalized String
    qualifiedName String
    The fully qualified domain name (FQDN) of the record.
    valueNormalized String
    The normalized value of the record.
    zoneId String
    The zone ID of the record.
    id string
    The provider-assigned unique ID for this managed resource.
    nameNormalized string
    qualifiedName string
    The fully qualified domain name (FQDN) of the record.
    valueNormalized string
    The normalized value of the record.
    zoneId string
    The zone ID of the record.
    id str
    The provider-assigned unique ID for this managed resource.
    name_normalized str
    qualified_name str
    The fully qualified domain name (FQDN) of the record.
    value_normalized str
    The normalized value of the record.
    zone_id str
    The zone ID of the record.
    id String
    The provider-assigned unique ID for this managed resource.
    nameNormalized String
    qualifiedName String
    The fully qualified domain name (FQDN) of the record.
    valueNormalized String
    The normalized value of the record.
    zoneId String
    The zone ID of the record.

    Look up Existing ZoneRecord Resource

    Get an existing ZoneRecord resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: ZoneRecordState, opts?: CustomResourceOptions): ZoneRecord
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            name: Optional[str] = None,
            name_normalized: Optional[str] = None,
            priority: Optional[int] = None,
            qualified_name: Optional[str] = None,
            regions: Optional[Sequence[str]] = None,
            ttl: Optional[int] = None,
            type: Optional[str] = None,
            value: Optional[str] = None,
            value_normalized: Optional[str] = None,
            zone_id: Optional[str] = None,
            zone_name: Optional[str] = None) -> ZoneRecord
    func GetZoneRecord(ctx *Context, name string, id IDInput, state *ZoneRecordState, opts ...ResourceOption) (*ZoneRecord, error)
    public static ZoneRecord Get(string name, Input<string> id, ZoneRecordState? state, CustomResourceOptions? opts = null)
    public static ZoneRecord get(String name, Output<String> id, ZoneRecordState state, CustomResourceOptions options)
    resources:  _:    type: dnsimple:ZoneRecord    get:      id: ${id}
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    Name string
    The name of the record. Use "" for the root domain.
    NameNormalized string
    Priority int
    The priority of the record. Only used for certain record types (e.g., MX, SRV).
    QualifiedName string
    The fully qualified domain name (FQDN) of the record.
    Regions List<string>
    A list of regions to serve the record from. You can find a list of supported values in our developer documentation.
    Ttl int
    The TTL of the record. Defaults to 3600.
    Type string
    The type of the record (e.g., A, AAAA, CNAME, MX, TXT). The record type must be specified in UPPERCASE.
    Value string
    The value of the record.
    ValueNormalized string
    The normalized value of the record.
    ZoneId string
    The zone ID of the record.
    ZoneName string
    The zone name to add the record to.
    Name string
    The name of the record. Use "" for the root domain.
    NameNormalized string
    Priority int
    The priority of the record. Only used for certain record types (e.g., MX, SRV).
    QualifiedName string
    The fully qualified domain name (FQDN) of the record.
    Regions []string
    A list of regions to serve the record from. You can find a list of supported values in our developer documentation.
    Ttl int
    The TTL of the record. Defaults to 3600.
    Type string
    The type of the record (e.g., A, AAAA, CNAME, MX, TXT). The record type must be specified in UPPERCASE.
    Value string
    The value of the record.
    ValueNormalized string
    The normalized value of the record.
    ZoneId string
    The zone ID of the record.
    ZoneName string
    The zone name to add the record to.
    name String
    The name of the record. Use "" for the root domain.
    nameNormalized String
    priority Integer
    The priority of the record. Only used for certain record types (e.g., MX, SRV).
    qualifiedName String
    The fully qualified domain name (FQDN) of the record.
    regions List<String>
    A list of regions to serve the record from. You can find a list of supported values in our developer documentation.
    ttl Integer
    The TTL of the record. Defaults to 3600.
    type String
    The type of the record (e.g., A, AAAA, CNAME, MX, TXT). The record type must be specified in UPPERCASE.
    value String
    The value of the record.
    valueNormalized String
    The normalized value of the record.
    zoneId String
    The zone ID of the record.
    zoneName String
    The zone name to add the record to.
    name string
    The name of the record. Use "" for the root domain.
    nameNormalized string
    priority number
    The priority of the record. Only used for certain record types (e.g., MX, SRV).
    qualifiedName string
    The fully qualified domain name (FQDN) of the record.
    regions string[]
    A list of regions to serve the record from. You can find a list of supported values in our developer documentation.
    ttl number
    The TTL of the record. Defaults to 3600.
    type string
    The type of the record (e.g., A, AAAA, CNAME, MX, TXT). The record type must be specified in UPPERCASE.
    value string
    The value of the record.
    valueNormalized string
    The normalized value of the record.
    zoneId string
    The zone ID of the record.
    zoneName string
    The zone name to add the record to.
    name str
    The name of the record. Use "" for the root domain.
    name_normalized str
    priority int
    The priority of the record. Only used for certain record types (e.g., MX, SRV).
    qualified_name str
    The fully qualified domain name (FQDN) of the record.
    regions Sequence[str]
    A list of regions to serve the record from. You can find a list of supported values in our developer documentation.
    ttl int
    The TTL of the record. Defaults to 3600.
    type str
    The type of the record (e.g., A, AAAA, CNAME, MX, TXT). The record type must be specified in UPPERCASE.
    value str
    The value of the record.
    value_normalized str
    The normalized value of the record.
    zone_id str
    The zone ID of the record.
    zone_name str
    The zone name to add the record to.
    name String
    The name of the record. Use "" for the root domain.
    nameNormalized String
    priority Number
    The priority of the record. Only used for certain record types (e.g., MX, SRV).
    qualifiedName String
    The fully qualified domain name (FQDN) of the record.
    regions List<String>
    A list of regions to serve the record from. You can find a list of supported values in our developer documentation.
    ttl Number
    The TTL of the record. Defaults to 3600.
    type String
    The type of the record (e.g., A, AAAA, CNAME, MX, TXT). The record type must be specified in UPPERCASE.
    value String
    The value of the record.
    valueNormalized String
    The normalized value of the record.
    zoneId String
    The zone ID of the record.
    zoneName String
    The zone name to add the record to.

    Import

    DNSimple zone records can be imported using the zone name and numeric record ID in the format zone_name_record_id.

    Importing record for example.com with record ID 1234:

    bash

    $ pulumi import dnsimple:index/zoneRecord:ZoneRecord example example.com_1234
    

    The record ID can be found in the URL when editing a record on the DNSimple web dashboard, or via the DNSimple Zone Records API.

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    DNSimple pulumi/pulumi-dnsimple
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the dnsimple Terraform Provider.
    dnsimple logo
    DNSimple v5.0.0 published on Tuesday, Dec 30, 2025 by Pulumi
      Meet Neo: Your AI Platform Teammate