1. Packages
  2. Ibm Provider
  3. API Docs
  4. DnsRecord
ibm 1.78.0 published on Wednesday, Apr 30, 2025 by ibm-cloud

ibm.DnsRecord

Explore with Pulumi AI

ibm logo
ibm 1.78.0 published on Wednesday, Apr 30, 2025 by ibm-cloud

    Provides a single-resource record entry in ibm.DnsDomain. Each resource record contains a host and a data property to define the name and target data of a resource.

    The IBM Cloud Classic Infrastructure (SoftLayer) object SoftLayer_Dns_Domain_ResourceRecord is used for most create-retrieve-update-delete (CRUD) operations. The IBM Cloud Classic Infrastructure (SoftLayer) object SoftLayer_Dns_Domain_ResourceRecord_SrvType is used for service record types (SRV).

    The SOA and NS records are automatically created by IBM Cloud Classic Infrastructure (SoftLayer) when the domain is created, you don’t need to create those manually.

    Example Usage

    A Record

    Review the IBM Cloud Classic Infrastructure Docs to implement the A record.

    import * as pulumi from "@pulumi/pulumi";
    import * as ibm from "@pulumi/ibm";
    
    const main = new ibm.DnsDomain("main", {});
    const www = new ibm.DnsRecord("www", {
        data: "123.123.123.123",
        domainId: main.dnsDomainId,
        host: "www.example.com",
        responsiblePerson: "user@softlayer.com",
        ttl: 900,
        type: "a",
    });
    
    import pulumi
    import pulumi_ibm as ibm
    
    main = ibm.DnsDomain("main")
    www = ibm.DnsRecord("www",
        data="123.123.123.123",
        domain_id=main.dns_domain_id,
        host="www.example.com",
        responsible_person="user@softlayer.com",
        ttl=900,
        type="a")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/ibm/ibm"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		main, err := ibm.NewDnsDomain(ctx, "main", nil)
    		if err != nil {
    			return err
    		}
    		_, err = ibm.NewDnsRecord(ctx, "www", &ibm.DnsRecordArgs{
    			Data:              pulumi.String("123.123.123.123"),
    			DomainId:          main.DnsDomainId,
    			Host:              pulumi.String("www.example.com"),
    			ResponsiblePerson: pulumi.String("user@softlayer.com"),
    			Ttl:               pulumi.Float64(900),
    			Type:              pulumi.String("a"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Ibm = Pulumi.Ibm;
    
    return await Deployment.RunAsync(() => 
    {
        var main = new Ibm.DnsDomain("main");
    
        var www = new Ibm.DnsRecord("www", new()
        {
            Data = "123.123.123.123",
            DomainId = main.DnsDomainId,
            Host = "www.example.com",
            ResponsiblePerson = "user@softlayer.com",
            Ttl = 900,
            Type = "a",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.ibm.DnsDomain;
    import com.pulumi.ibm.DnsRecord;
    import com.pulumi.ibm.DnsRecordArgs;
    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) {
            var main = new DnsDomain("main");
    
            var www = new DnsRecord("www", DnsRecordArgs.builder()
                .data("123.123.123.123")
                .domainId(main.dnsDomainId())
                .host("www.example.com")
                .responsiblePerson("user@softlayer.com")
                .ttl(900)
                .type("a")
                .build());
    
        }
    }
    
    resources:
      main:
        type: ibm:DnsDomain
      www:
        type: ibm:DnsRecord
        properties:
          data: 123.123.123.123
          domainId: ${main.dnsDomainId}
          host: www.example.com
          responsiblePerson: user@softlayer.com
          ttl: 900
          type: a
    

    AAAA Record

    Review the IBM Cloud Classic Infrastructure documentation to implement the AAAA record.

    import * as pulumi from "@pulumi/pulumi";
    import * as ibm from "@pulumi/ibm";
    
    const aaaa = new ibm.DnsRecord("aaaa", {
        data: "fe80:0000:0000:0000:0202:b3ff:fe1e:8329",
        domainId: ibm_dns_domain.main.id,
        host: "www.example.com",
        responsiblePerson: "user@softlayer.com",
        ttl: 1000,
        type: "aaaa",
    });
    
    import pulumi
    import pulumi_ibm as ibm
    
    aaaa = ibm.DnsRecord("aaaa",
        data="fe80:0000:0000:0000:0202:b3ff:fe1e:8329",
        domain_id=ibm_dns_domain["main"]["id"],
        host="www.example.com",
        responsible_person="user@softlayer.com",
        ttl=1000,
        type="aaaa")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/ibm/ibm"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := ibm.NewDnsRecord(ctx, "aaaa", &ibm.DnsRecordArgs{
    			Data:              pulumi.String("fe80:0000:0000:0000:0202:b3ff:fe1e:8329"),
    			DomainId:          pulumi.Any(ibm_dns_domain.Main.Id),
    			Host:              pulumi.String("www.example.com"),
    			ResponsiblePerson: pulumi.String("user@softlayer.com"),
    			Ttl:               pulumi.Float64(1000),
    			Type:              pulumi.String("aaaa"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Ibm = Pulumi.Ibm;
    
    return await Deployment.RunAsync(() => 
    {
        var aaaa = new Ibm.DnsRecord("aaaa", new()
        {
            Data = "fe80:0000:0000:0000:0202:b3ff:fe1e:8329",
            DomainId = ibm_dns_domain.Main.Id,
            Host = "www.example.com",
            ResponsiblePerson = "user@softlayer.com",
            Ttl = 1000,
            Type = "aaaa",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.ibm.DnsRecord;
    import com.pulumi.ibm.DnsRecordArgs;
    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) {
            var aaaa = new DnsRecord("aaaa", DnsRecordArgs.builder()
                .data("fe80:0000:0000:0000:0202:b3ff:fe1e:8329")
                .domainId(ibm_dns_domain.main().id())
                .host("www.example.com")
                .responsiblePerson("user@softlayer.com")
                .ttl(1000)
                .type("aaaa")
                .build());
    
        }
    }
    
    resources:
      aaaa:
        type: ibm:DnsRecord
        properties:
          data: fe80:0000:0000:0000:0202:b3ff:fe1e:8329
          domainId: ${ibm_dns_domain.main.id}
          host: www.example.com
          responsiblePerson: user@softlayer.com
          ttl: 1000
          type: aaaa
    

    CNAME Record

    Review the IBM Cloud Classic Infrastructure documentation to implement the CNAME record.

    import * as pulumi from "@pulumi/pulumi";
    import * as ibm from "@pulumi/ibm";
    
    const cname = new ibm.DnsRecord("cname", {
        data: "real-host.example.com.",
        domainId: ibm_dns_domain.main.id,
        host: "alias.example.com",
        responsiblePerson: "user@softlayer.com",
        ttl: 900,
        type: "cname",
    });
    
    import pulumi
    import pulumi_ibm as ibm
    
    cname = ibm.DnsRecord("cname",
        data="real-host.example.com.",
        domain_id=ibm_dns_domain["main"]["id"],
        host="alias.example.com",
        responsible_person="user@softlayer.com",
        ttl=900,
        type="cname")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/ibm/ibm"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := ibm.NewDnsRecord(ctx, "cname", &ibm.DnsRecordArgs{
    			Data:              pulumi.String("real-host.example.com."),
    			DomainId:          pulumi.Any(ibm_dns_domain.Main.Id),
    			Host:              pulumi.String("alias.example.com"),
    			ResponsiblePerson: pulumi.String("user@softlayer.com"),
    			Ttl:               pulumi.Float64(900),
    			Type:              pulumi.String("cname"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Ibm = Pulumi.Ibm;
    
    return await Deployment.RunAsync(() => 
    {
        var cname = new Ibm.DnsRecord("cname", new()
        {
            Data = "real-host.example.com.",
            DomainId = ibm_dns_domain.Main.Id,
            Host = "alias.example.com",
            ResponsiblePerson = "user@softlayer.com",
            Ttl = 900,
            Type = "cname",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.ibm.DnsRecord;
    import com.pulumi.ibm.DnsRecordArgs;
    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) {
            var cname = new DnsRecord("cname", DnsRecordArgs.builder()
                .data("real-host.example.com.")
                .domainId(ibm_dns_domain.main().id())
                .host("alias.example.com")
                .responsiblePerson("user@softlayer.com")
                .ttl(900)
                .type("cname")
                .build());
    
        }
    }
    
    resources:
      cname:
        type: ibm:DnsRecord
        properties:
          data: real-host.example.com.
          domainId: ${ibm_dns_domain.main.id}
          host: alias.example.com
          responsiblePerson: user@softlayer.com
          ttl: 900
          type: cname
    

    NS Record

    Review the IBM Cloud Classic Infrastructure Docs to implement the NS record.

    import * as pulumi from "@pulumi/pulumi";
    import * as ibm from "@pulumi/ibm";
    
    const recordNS = new ibm.DnsRecord("recordNS", {
        data: "ns.example.com.",
        domainId: ibm_dns_domain.main.id,
        host: "example.com",
        responsiblePerson: "user@softlayer.com",
        ttl: 900,
        type: "ns",
    });
    
    import pulumi
    import pulumi_ibm as ibm
    
    record_ns = ibm.DnsRecord("recordNS",
        data="ns.example.com.",
        domain_id=ibm_dns_domain["main"]["id"],
        host="example.com",
        responsible_person="user@softlayer.com",
        ttl=900,
        type="ns")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/ibm/ibm"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := ibm.NewDnsRecord(ctx, "recordNS", &ibm.DnsRecordArgs{
    			Data:              pulumi.String("ns.example.com."),
    			DomainId:          pulumi.Any(ibm_dns_domain.Main.Id),
    			Host:              pulumi.String("example.com"),
    			ResponsiblePerson: pulumi.String("user@softlayer.com"),
    			Ttl:               pulumi.Float64(900),
    			Type:              pulumi.String("ns"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Ibm = Pulumi.Ibm;
    
    return await Deployment.RunAsync(() => 
    {
        var recordNS = new Ibm.DnsRecord("recordNS", new()
        {
            Data = "ns.example.com.",
            DomainId = ibm_dns_domain.Main.Id,
            Host = "example.com",
            ResponsiblePerson = "user@softlayer.com",
            Ttl = 900,
            Type = "ns",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.ibm.DnsRecord;
    import com.pulumi.ibm.DnsRecordArgs;
    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) {
            var recordNS = new DnsRecord("recordNS", DnsRecordArgs.builder()
                .data("ns.example.com.")
                .domainId(ibm_dns_domain.main().id())
                .host("example.com")
                .responsiblePerson("user@softlayer.com")
                .ttl(900)
                .type("ns")
                .build());
    
        }
    }
    
    resources:
      recordNS:
        type: ibm:DnsRecord
        properties:
          data: ns.example.com.
          domainId: ${ibm_dns_domain.main.id}
          host: example.com
          responsiblePerson: user@softlayer.com
          ttl: 900
          type: ns
    

    MX Record

    Review the IBM Cloud Classic Infrastructure Docs to implement the MX record.

    import * as pulumi from "@pulumi/pulumi";
    import * as sibm from "@pulumi/sibm";
    
    const recordMX_1 = new sibm.index.Sibm_dns_record("recordMX-1", {
        data: "mail-1",
        domainId: ibm_dns_domain.main.id,
        host: "@",
        mxPriority: "10",
        responsiblePerson: "user@softlayer.com",
        ttl: 900,
        type: "mx",
    });
    
    import pulumi
    import pulumi_sibm as sibm
    
    record_m_x_1 = sibm.index.Sibm_dns_record("recordMX-1",
        data=mail-1,
        domain_id=ibm_dns_domain.main.id,
        host=@,
        mx_priority=10,
        responsible_person=user@softlayer.com,
        ttl=900,
        type=mx)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-sibm/sdk/go/sibm"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := sibm.NewSibm_dns_record(ctx, "recordMX-1", &sibm.Sibm_dns_recordArgs{
    			Data:              "mail-1",
    			DomainId:          ibm_dns_domain.Main.Id,
    			Host:              "@",
    			MxPriority:        "10",
    			ResponsiblePerson: "user@softlayer.com",
    			Ttl:               900,
    			Type:              "mx",
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Sibm = Pulumi.Sibm;
    
    return await Deployment.RunAsync(() => 
    {
        var recordMX_1 = new Sibm.Index.Sibm_dns_record("recordMX-1", new()
        {
            Data = "mail-1",
            DomainId = ibm_dns_domain.Main.Id,
            Host = "@",
            MxPriority = "10",
            ResponsiblePerson = "user@softlayer.com",
            Ttl = 900,
            Type = "mx",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.sibm.sibm_dns_record;
    import com.pulumi.sibm.Sibm_dns_recordArgs;
    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) {
            var recordMX_1 = new Sibm_dns_record("recordMX-1", Sibm_dns_recordArgs.builder()
                .data("mail-1")
                .domainId(ibm_dns_domain.main().id())
                .host("@")
                .mxPriority("10")
                .responsiblePerson("user@softlayer.com")
                .ttl(900)
                .type("mx")
                .build());
    
        }
    }
    
    resources:
      recordMX-1:
        type: sibm:sibm_dns_record
        properties:
          data: mail-1
          domainId: ${ibm_dns_domain.main.id}
          host: '@'
          mxPriority: '10'
          responsiblePerson: user@softlayer.com
          ttl: 900
          type: mx
    

    SOA Record

    Review the IBM Cloud Classic Infrastructure Docs to implement the SOA record.

    import * as pulumi from "@pulumi/pulumi";
    import * as ibm from "@pulumi/ibm";
    
    const recordSOA = new ibm.DnsRecord("recordSOA", {
        data: "ns1.example.com. abuse.example.com. 2018101002 7200 600 1728000 43200",
        domainId: ibm_dns_domain.main.id,
        host: "example.com",
        responsiblePerson: "user@softlayer.com",
        ttl: 900,
        type: "soa",
    });
    
    import pulumi
    import pulumi_ibm as ibm
    
    record_soa = ibm.DnsRecord("recordSOA",
        data="ns1.example.com. abuse.example.com. 2018101002 7200 600 1728000 43200",
        domain_id=ibm_dns_domain["main"]["id"],
        host="example.com",
        responsible_person="user@softlayer.com",
        ttl=900,
        type="soa")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/ibm/ibm"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := ibm.NewDnsRecord(ctx, "recordSOA", &ibm.DnsRecordArgs{
    			Data:              pulumi.String("ns1.example.com. abuse.example.com. 2018101002 7200 600 1728000 43200"),
    			DomainId:          pulumi.Any(ibm_dns_domain.Main.Id),
    			Host:              pulumi.String("example.com"),
    			ResponsiblePerson: pulumi.String("user@softlayer.com"),
    			Ttl:               pulumi.Float64(900),
    			Type:              pulumi.String("soa"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Ibm = Pulumi.Ibm;
    
    return await Deployment.RunAsync(() => 
    {
        var recordSOA = new Ibm.DnsRecord("recordSOA", new()
        {
            Data = "ns1.example.com. abuse.example.com. 2018101002 7200 600 1728000 43200",
            DomainId = ibm_dns_domain.Main.Id,
            Host = "example.com",
            ResponsiblePerson = "user@softlayer.com",
            Ttl = 900,
            Type = "soa",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.ibm.DnsRecord;
    import com.pulumi.ibm.DnsRecordArgs;
    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) {
            var recordSOA = new DnsRecord("recordSOA", DnsRecordArgs.builder()
                .data("ns1.example.com. abuse.example.com. 2018101002 7200 600 1728000 43200")
                .domainId(ibm_dns_domain.main().id())
                .host("example.com")
                .responsiblePerson("user@softlayer.com")
                .ttl(900)
                .type("soa")
                .build());
    
        }
    }
    
    resources:
      recordSOA:
        type: ibm:DnsRecord
        properties:
          data: ns1.example.com. abuse.example.com. 2018101002 7200 600 1728000 43200
          domainId: ${ibm_dns_domain.main.id}
          host: example.com
          responsiblePerson: user@softlayer.com
          ttl: 900
          type: soa
    

    SPF Record

    Review the IBM Cloud Classic Infrastructure Docs to implement the SPF record.

    import * as pulumi from "@pulumi/pulumi";
    import * as ibm from "@pulumi/ibm";
    
    const recordSPF = new ibm.DnsRecord("recordSPF", {
        data: "v=spf1 mx:mail.example.org ~all",
        domainId: ibm_dns_domain.main.id,
        host: "mail-1",
        responsiblePerson: "user@softlayer.com",
        ttl: 900,
        type: "spf",
    });
    
    import pulumi
    import pulumi_ibm as ibm
    
    record_spf = ibm.DnsRecord("recordSPF",
        data="v=spf1 mx:mail.example.org ~all",
        domain_id=ibm_dns_domain["main"]["id"],
        host="mail-1",
        responsible_person="user@softlayer.com",
        ttl=900,
        type="spf")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/ibm/ibm"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := ibm.NewDnsRecord(ctx, "recordSPF", &ibm.DnsRecordArgs{
    			Data:              pulumi.String("v=spf1 mx:mail.example.org ~all"),
    			DomainId:          pulumi.Any(ibm_dns_domain.Main.Id),
    			Host:              pulumi.String("mail-1"),
    			ResponsiblePerson: pulumi.String("user@softlayer.com"),
    			Ttl:               pulumi.Float64(900),
    			Type:              pulumi.String("spf"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Ibm = Pulumi.Ibm;
    
    return await Deployment.RunAsync(() => 
    {
        var recordSPF = new Ibm.DnsRecord("recordSPF", new()
        {
            Data = "v=spf1 mx:mail.example.org ~all",
            DomainId = ibm_dns_domain.Main.Id,
            Host = "mail-1",
            ResponsiblePerson = "user@softlayer.com",
            Ttl = 900,
            Type = "spf",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.ibm.DnsRecord;
    import com.pulumi.ibm.DnsRecordArgs;
    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) {
            var recordSPF = new DnsRecord("recordSPF", DnsRecordArgs.builder()
                .data("v=spf1 mx:mail.example.org ~all")
                .domainId(ibm_dns_domain.main().id())
                .host("mail-1")
                .responsiblePerson("user@softlayer.com")
                .ttl(900)
                .type("spf")
                .build());
    
        }
    }
    
    resources:
      recordSPF:
        type: ibm:DnsRecord
        properties:
          data: v=spf1 mx:mail.example.org ~all
          domainId: ${ibm_dns_domain.main.id}
          host: mail-1
          responsiblePerson: user@softlayer.com
          ttl: 900
          type: spf
    

    TXT Record

    Review the IBM Cloud Classic Infrastructure Docs to implement the TXT record.

    import * as pulumi from "@pulumi/pulumi";
    import * as ibm from "@pulumi/ibm";
    
    const recordTXT = new ibm.DnsRecord("recordTXT", {
        data: "host",
        domainId: ibm_dns_domain.main.id,
        host: "A SPF test host",
        responsiblePerson: "user@softlayer.com",
        ttl: 900,
        type: "txt",
    });
    
    import pulumi
    import pulumi_ibm as ibm
    
    record_txt = ibm.DnsRecord("recordTXT",
        data="host",
        domain_id=ibm_dns_domain["main"]["id"],
        host="A SPF test host",
        responsible_person="user@softlayer.com",
        ttl=900,
        type="txt")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/ibm/ibm"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := ibm.NewDnsRecord(ctx, "recordTXT", &ibm.DnsRecordArgs{
    			Data:              pulumi.String("host"),
    			DomainId:          pulumi.Any(ibm_dns_domain.Main.Id),
    			Host:              pulumi.String("A SPF test host"),
    			ResponsiblePerson: pulumi.String("user@softlayer.com"),
    			Ttl:               pulumi.Float64(900),
    			Type:              pulumi.String("txt"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Ibm = Pulumi.Ibm;
    
    return await Deployment.RunAsync(() => 
    {
        var recordTXT = new Ibm.DnsRecord("recordTXT", new()
        {
            Data = "host",
            DomainId = ibm_dns_domain.Main.Id,
            Host = "A SPF test host",
            ResponsiblePerson = "user@softlayer.com",
            Ttl = 900,
            Type = "txt",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.ibm.DnsRecord;
    import com.pulumi.ibm.DnsRecordArgs;
    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) {
            var recordTXT = new DnsRecord("recordTXT", DnsRecordArgs.builder()
                .data("host")
                .domainId(ibm_dns_domain.main().id())
                .host("A SPF test host")
                .responsiblePerson("user@softlayer.com")
                .ttl(900)
                .type("txt")
                .build());
    
        }
    }
    
    resources:
      recordTXT:
        type: ibm:DnsRecord
        properties:
          data: host
          domainId: ${ibm_dns_domain.main.id}
          host: A SPF test host
          responsiblePerson: user@softlayer.com
          ttl: 900
          type: txt
    

    SRV Record

    Review the IBM Cloud Classic Infrastructure Docs to implement the SRV record.

    import * as pulumi from "@pulumi/pulumi";
    import * as ibm from "@pulumi/ibm";
    
    const recordSRV = new ibm.DnsRecord("recordSRV", {
        data: "ns1.example.org",
        domainId: ibm_dns_domain.main.id,
        host: "hosta-srv.com",
        responsiblePerson: "user@softlayer.com",
        ttl: 900,
        type: "srv",
        port: 8080,
        priority: 3,
        protocol: "_tcp",
        weight: 3,
        service: "_mail",
    });
    
    import pulumi
    import pulumi_ibm as ibm
    
    record_srv = ibm.DnsRecord("recordSRV",
        data="ns1.example.org",
        domain_id=ibm_dns_domain["main"]["id"],
        host="hosta-srv.com",
        responsible_person="user@softlayer.com",
        ttl=900,
        type="srv",
        port=8080,
        priority=3,
        protocol="_tcp",
        weight=3,
        service="_mail")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/ibm/ibm"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := ibm.NewDnsRecord(ctx, "recordSRV", &ibm.DnsRecordArgs{
    			Data:              pulumi.String("ns1.example.org"),
    			DomainId:          pulumi.Any(ibm_dns_domain.Main.Id),
    			Host:              pulumi.String("hosta-srv.com"),
    			ResponsiblePerson: pulumi.String("user@softlayer.com"),
    			Ttl:               pulumi.Float64(900),
    			Type:              pulumi.String("srv"),
    			Port:              pulumi.Float64(8080),
    			Priority:          pulumi.Float64(3),
    			Protocol:          pulumi.String("_tcp"),
    			Weight:            pulumi.Float64(3),
    			Service:           pulumi.String("_mail"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Ibm = Pulumi.Ibm;
    
    return await Deployment.RunAsync(() => 
    {
        var recordSRV = new Ibm.DnsRecord("recordSRV", new()
        {
            Data = "ns1.example.org",
            DomainId = ibm_dns_domain.Main.Id,
            Host = "hosta-srv.com",
            ResponsiblePerson = "user@softlayer.com",
            Ttl = 900,
            Type = "srv",
            Port = 8080,
            Priority = 3,
            Protocol = "_tcp",
            Weight = 3,
            Service = "_mail",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.ibm.DnsRecord;
    import com.pulumi.ibm.DnsRecordArgs;
    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) {
            var recordSRV = new DnsRecord("recordSRV", DnsRecordArgs.builder()
                .data("ns1.example.org")
                .domainId(ibm_dns_domain.main().id())
                .host("hosta-srv.com")
                .responsiblePerson("user@softlayer.com")
                .ttl(900)
                .type("srv")
                .port(8080)
                .priority(3)
                .protocol("_tcp")
                .weight(3)
                .service("_mail")
                .build());
    
        }
    }
    
    resources:
      recordSRV:
        type: ibm:DnsRecord
        properties:
          data: ns1.example.org
          domainId: ${ibm_dns_domain.main.id}
          host: hosta-srv.com
          responsiblePerson: user@softlayer.com
          ttl: 900
          type: srv
          port: 8080
          priority: 3
          protocol: _tcp
          weight: 3
          service: _mail
    

    PTR Record

    Review the IBM Cloud Classic Infrastructure Docs to implement the PTR record.

    import * as pulumi from "@pulumi/pulumi";
    import * as ibm from "@pulumi/ibm";
    
    const recordPTR = new ibm.DnsRecord("recordPTR", {
        data: "ptr.example.com",
        domainId: ibm_dns_domain.main.id,
        host: "45",
        responsiblePerson: "user@softlayer.com",
        ttl: 900,
        type: "ptr",
    });
    
    import pulumi
    import pulumi_ibm as ibm
    
    record_ptr = ibm.DnsRecord("recordPTR",
        data="ptr.example.com",
        domain_id=ibm_dns_domain["main"]["id"],
        host="45",
        responsible_person="user@softlayer.com",
        ttl=900,
        type="ptr")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/ibm/ibm"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := ibm.NewDnsRecord(ctx, "recordPTR", &ibm.DnsRecordArgs{
    			Data:              pulumi.String("ptr.example.com"),
    			DomainId:          pulumi.Any(ibm_dns_domain.Main.Id),
    			Host:              pulumi.String("45"),
    			ResponsiblePerson: pulumi.String("user@softlayer.com"),
    			Ttl:               pulumi.Float64(900),
    			Type:              pulumi.String("ptr"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Ibm = Pulumi.Ibm;
    
    return await Deployment.RunAsync(() => 
    {
        var recordPTR = new Ibm.DnsRecord("recordPTR", new()
        {
            Data = "ptr.example.com",
            DomainId = ibm_dns_domain.Main.Id,
            Host = "45",
            ResponsiblePerson = "user@softlayer.com",
            Ttl = 900,
            Type = "ptr",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.ibm.DnsRecord;
    import com.pulumi.ibm.DnsRecordArgs;
    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) {
            var recordPTR = new DnsRecord("recordPTR", DnsRecordArgs.builder()
                .data("ptr.example.com")
                .domainId(ibm_dns_domain.main().id())
                .host("45")
                .responsiblePerson("user@softlayer.com")
                .ttl(900)
                .type("ptr")
                .build());
    
        }
    }
    
    resources:
      recordPTR:
        type: ibm:DnsRecord
        properties:
          data: ptr.example.com
          domainId: ${ibm_dns_domain.main.id}
          # The host is the last octet of IP address in the range of the subnet
          host: '45'
          responsiblePerson: user@softlayer.com
          ttl: 900
          type: ptr
    

    Create DnsRecord Resource

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

    Constructor syntax

    new DnsRecord(name: string, args: DnsRecordArgs, opts?: CustomResourceOptions);
    @overload
    def DnsRecord(resource_name: str,
                  args: DnsRecordArgs,
                  opts: Optional[ResourceOptions] = None)
    
    @overload
    def DnsRecord(resource_name: str,
                  opts: Optional[ResourceOptions] = None,
                  host: Optional[str] = None,
                  type: Optional[str] = None,
                  domain_id: Optional[float] = None,
                  data: Optional[str] = None,
                  priority: Optional[float] = None,
                  responsible_person: Optional[str] = None,
                  mx_priority: Optional[float] = None,
                  port: Optional[float] = None,
                  expire: Optional[float] = None,
                  protocol: Optional[str] = None,
                  refresh: Optional[float] = None,
                  minimum_ttl: Optional[float] = None,
                  retry: Optional[float] = None,
                  service: Optional[str] = None,
                  tags: Optional[Sequence[str]] = None,
                  ttl: Optional[float] = None,
                  dns_record_id: Optional[str] = None,
                  weight: Optional[float] = None)
    func NewDnsRecord(ctx *Context, name string, args DnsRecordArgs, opts ...ResourceOption) (*DnsRecord, error)
    public DnsRecord(string name, DnsRecordArgs args, CustomResourceOptions? opts = null)
    public DnsRecord(String name, DnsRecordArgs args)
    public DnsRecord(String name, DnsRecordArgs args, CustomResourceOptions options)
    
    type: ibm:DnsRecord
    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 DnsRecordArgs
    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 DnsRecordArgs
    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 DnsRecordArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args DnsRecordArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args DnsRecordArgs
    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 dnsRecordResource = new Ibm.DnsRecord("dnsRecordResource", new()
    {
        Host = "string",
        Type = "string",
        DomainId = 0,
        Data = "string",
        Priority = 0,
        ResponsiblePerson = "string",
        MxPriority = 0,
        Port = 0,
        Expire = 0,
        Protocol = "string",
        Refresh = 0,
        MinimumTtl = 0,
        Retry = 0,
        Service = "string",
        Tags = new[]
        {
            "string",
        },
        Ttl = 0,
        DnsRecordId = "string",
        Weight = 0,
    });
    
    example, err := ibm.NewDnsRecord(ctx, "dnsRecordResource", &ibm.DnsRecordArgs{
    	Host:              pulumi.String("string"),
    	Type:              pulumi.String("string"),
    	DomainId:          pulumi.Float64(0),
    	Data:              pulumi.String("string"),
    	Priority:          pulumi.Float64(0),
    	ResponsiblePerson: pulumi.String("string"),
    	MxPriority:        pulumi.Float64(0),
    	Port:              pulumi.Float64(0),
    	Expire:            pulumi.Float64(0),
    	Protocol:          pulumi.String("string"),
    	Refresh:           pulumi.Float64(0),
    	MinimumTtl:        pulumi.Float64(0),
    	Retry:             pulumi.Float64(0),
    	Service:           pulumi.String("string"),
    	Tags: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	Ttl:         pulumi.Float64(0),
    	DnsRecordId: pulumi.String("string"),
    	Weight:      pulumi.Float64(0),
    })
    
    var dnsRecordResource = new DnsRecord("dnsRecordResource", DnsRecordArgs.builder()
        .host("string")
        .type("string")
        .domainId(0)
        .data("string")
        .priority(0)
        .responsiblePerson("string")
        .mxPriority(0)
        .port(0)
        .expire(0)
        .protocol("string")
        .refresh(0)
        .minimumTtl(0)
        .retry(0)
        .service("string")
        .tags("string")
        .ttl(0)
        .dnsRecordId("string")
        .weight(0)
        .build());
    
    dns_record_resource = ibm.DnsRecord("dnsRecordResource",
        host="string",
        type="string",
        domain_id=0,
        data="string",
        priority=0,
        responsible_person="string",
        mx_priority=0,
        port=0,
        expire=0,
        protocol="string",
        refresh=0,
        minimum_ttl=0,
        retry=0,
        service="string",
        tags=["string"],
        ttl=0,
        dns_record_id="string",
        weight=0)
    
    const dnsRecordResource = new ibm.DnsRecord("dnsRecordResource", {
        host: "string",
        type: "string",
        domainId: 0,
        data: "string",
        priority: 0,
        responsiblePerson: "string",
        mxPriority: 0,
        port: 0,
        expire: 0,
        protocol: "string",
        refresh: 0,
        minimumTtl: 0,
        retry: 0,
        service: "string",
        tags: ["string"],
        ttl: 0,
        dnsRecordId: "string",
        weight: 0,
    });
    
    type: ibm:DnsRecord
    properties:
        data: string
        dnsRecordId: string
        domainId: 0
        expire: 0
        host: string
        minimumTtl: 0
        mxPriority: 0
        port: 0
        priority: 0
        protocol: string
        refresh: 0
        responsiblePerson: string
        retry: 0
        service: string
        tags:
            - string
        ttl: 0
        type: string
        weight: 0
    

    DnsRecord 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 DnsRecord resource accepts the following input properties:

    Data string
    The IP address or a hostname of a domain's resource record. Fully qualified host and domain name data must end with the . character.
    DomainId double
    The ID for the domain associated with the resource record.
    Host string
    The host defined by a resource record. The @ symbol denotes a wildcard.
    Type string
    The type of domain resource record. Accepted values are as follows:
    DnsRecordId string
    (String) The internal identifier of the domain resource record.
    Expire double
    T he duration, expressed in seconds, that a secondary name server (or servers) holds a zone before it is no longer considered authoritative.
    MinimumTtl double
    The duration, expressed in seconds, that a domain's resource records are valid. This is also known as a minimum time to live (TTL), and can be overridden by an individual resource record's TTL.
    MxPriority double
    The priority of the mail exchanger that delivers mail for a domain. This is useful in cases where a domain has more than one mail exchanger. A lower number denotes a higher priority, and mail attempt to deliver through the highest priority exchanger before moving to lower priority exchanger. The default value is 0.
    Port double
    SRV records only. The TCP or UDP port on which the service be found.
    Priority double
    SRV records only. The priority of the target host. The lowest numerical value is given the highest priority. The default value is 0.
    Protocol string
    SRV records only. The protocol of the service that you want to use, such as TCP or UDP.
    Refresh double
    The duration expressed in seconds, that a secondary name server waits to check the domain's primary name server for a new copy of a DNS zone. If a zone file has changed, the secondary DNS server updates its copy of the zone to match the primary DNS server's zone.
    ResponsiblePerson string
    The email address of the person responsible for a domain. Replace the @ symbol in the address with a .. For example, root@example.org would be expressed as root.example.org..
    Retry double
    The duration, expressed in seconds, that the domain's primary name server (or servers) waits before attempting to refresh the domain's zone with the secondary name server. A failed attempt to refresh by a secondary name server triggers the retry action.
    Service string
    SRV records only. The symbolic name of the service.
    Tags List<string>
    Tags associated with the DNS domain record instance.
    Note Tags are managed locally and not stored on the IBM Cloud Service Endpoint at this moment.
    Ttl double
    The time to live (TTL) duration, expressed in seconds, of a resource record. A name server uses TTL to determine how long to cache a resource record. An SOA record's TTL value defines the domain's overall TTL.
    Weight double
    SRV records only. A relative weight for records that have the same priority. The default value is 0.
    Data string
    The IP address or a hostname of a domain's resource record. Fully qualified host and domain name data must end with the . character.
    DomainId float64
    The ID for the domain associated with the resource record.
    Host string
    The host defined by a resource record. The @ symbol denotes a wildcard.
    Type string
    The type of domain resource record. Accepted values are as follows:
    DnsRecordId string
    (String) The internal identifier of the domain resource record.
    Expire float64
    T he duration, expressed in seconds, that a secondary name server (or servers) holds a zone before it is no longer considered authoritative.
    MinimumTtl float64
    The duration, expressed in seconds, that a domain's resource records are valid. This is also known as a minimum time to live (TTL), and can be overridden by an individual resource record's TTL.
    MxPriority float64
    The priority of the mail exchanger that delivers mail for a domain. This is useful in cases where a domain has more than one mail exchanger. A lower number denotes a higher priority, and mail attempt to deliver through the highest priority exchanger before moving to lower priority exchanger. The default value is 0.
    Port float64
    SRV records only. The TCP or UDP port on which the service be found.
    Priority float64
    SRV records only. The priority of the target host. The lowest numerical value is given the highest priority. The default value is 0.
    Protocol string
    SRV records only. The protocol of the service that you want to use, such as TCP or UDP.
    Refresh float64
    The duration expressed in seconds, that a secondary name server waits to check the domain's primary name server for a new copy of a DNS zone. If a zone file has changed, the secondary DNS server updates its copy of the zone to match the primary DNS server's zone.
    ResponsiblePerson string
    The email address of the person responsible for a domain. Replace the @ symbol in the address with a .. For example, root@example.org would be expressed as root.example.org..
    Retry float64
    The duration, expressed in seconds, that the domain's primary name server (or servers) waits before attempting to refresh the domain's zone with the secondary name server. A failed attempt to refresh by a secondary name server triggers the retry action.
    Service string
    SRV records only. The symbolic name of the service.
    Tags []string
    Tags associated with the DNS domain record instance.
    Note Tags are managed locally and not stored on the IBM Cloud Service Endpoint at this moment.
    Ttl float64
    The time to live (TTL) duration, expressed in seconds, of a resource record. A name server uses TTL to determine how long to cache a resource record. An SOA record's TTL value defines the domain's overall TTL.
    Weight float64
    SRV records only. A relative weight for records that have the same priority. The default value is 0.
    data String
    The IP address or a hostname of a domain's resource record. Fully qualified host and domain name data must end with the . character.
    domainId Double
    The ID for the domain associated with the resource record.
    host String
    The host defined by a resource record. The @ symbol denotes a wildcard.
    type String
    The type of domain resource record. Accepted values are as follows:
    dnsRecordId String
    (String) The internal identifier of the domain resource record.
    expire Double
    T he duration, expressed in seconds, that a secondary name server (or servers) holds a zone before it is no longer considered authoritative.
    minimumTtl Double
    The duration, expressed in seconds, that a domain's resource records are valid. This is also known as a minimum time to live (TTL), and can be overridden by an individual resource record's TTL.
    mxPriority Double
    The priority of the mail exchanger that delivers mail for a domain. This is useful in cases where a domain has more than one mail exchanger. A lower number denotes a higher priority, and mail attempt to deliver through the highest priority exchanger before moving to lower priority exchanger. The default value is 0.
    port Double
    SRV records only. The TCP or UDP port on which the service be found.
    priority Double
    SRV records only. The priority of the target host. The lowest numerical value is given the highest priority. The default value is 0.
    protocol String
    SRV records only. The protocol of the service that you want to use, such as TCP or UDP.
    refresh Double
    The duration expressed in seconds, that a secondary name server waits to check the domain's primary name server for a new copy of a DNS zone. If a zone file has changed, the secondary DNS server updates its copy of the zone to match the primary DNS server's zone.
    responsiblePerson String
    The email address of the person responsible for a domain. Replace the @ symbol in the address with a .. For example, root@example.org would be expressed as root.example.org..
    retry Double
    The duration, expressed in seconds, that the domain's primary name server (or servers) waits before attempting to refresh the domain's zone with the secondary name server. A failed attempt to refresh by a secondary name server triggers the retry action.
    service String
    SRV records only. The symbolic name of the service.
    tags List<String>
    Tags associated with the DNS domain record instance.
    Note Tags are managed locally and not stored on the IBM Cloud Service Endpoint at this moment.
    ttl Double
    The time to live (TTL) duration, expressed in seconds, of a resource record. A name server uses TTL to determine how long to cache a resource record. An SOA record's TTL value defines the domain's overall TTL.
    weight Double
    SRV records only. A relative weight for records that have the same priority. The default value is 0.
    data string
    The IP address or a hostname of a domain's resource record. Fully qualified host and domain name data must end with the . character.
    domainId number
    The ID for the domain associated with the resource record.
    host string
    The host defined by a resource record. The @ symbol denotes a wildcard.
    type string
    The type of domain resource record. Accepted values are as follows:
    dnsRecordId string
    (String) The internal identifier of the domain resource record.
    expire number
    T he duration, expressed in seconds, that a secondary name server (or servers) holds a zone before it is no longer considered authoritative.
    minimumTtl number
    The duration, expressed in seconds, that a domain's resource records are valid. This is also known as a minimum time to live (TTL), and can be overridden by an individual resource record's TTL.
    mxPriority number
    The priority of the mail exchanger that delivers mail for a domain. This is useful in cases where a domain has more than one mail exchanger. A lower number denotes a higher priority, and mail attempt to deliver through the highest priority exchanger before moving to lower priority exchanger. The default value is 0.
    port number
    SRV records only. The TCP or UDP port on which the service be found.
    priority number
    SRV records only. The priority of the target host. The lowest numerical value is given the highest priority. The default value is 0.
    protocol string
    SRV records only. The protocol of the service that you want to use, such as TCP or UDP.
    refresh number
    The duration expressed in seconds, that a secondary name server waits to check the domain's primary name server for a new copy of a DNS zone. If a zone file has changed, the secondary DNS server updates its copy of the zone to match the primary DNS server's zone.
    responsiblePerson string
    The email address of the person responsible for a domain. Replace the @ symbol in the address with a .. For example, root@example.org would be expressed as root.example.org..
    retry number
    The duration, expressed in seconds, that the domain's primary name server (or servers) waits before attempting to refresh the domain's zone with the secondary name server. A failed attempt to refresh by a secondary name server triggers the retry action.
    service string
    SRV records only. The symbolic name of the service.
    tags string[]
    Tags associated with the DNS domain record instance.
    Note Tags are managed locally and not stored on the IBM Cloud Service Endpoint at this moment.
    ttl number
    The time to live (TTL) duration, expressed in seconds, of a resource record. A name server uses TTL to determine how long to cache a resource record. An SOA record's TTL value defines the domain's overall TTL.
    weight number
    SRV records only. A relative weight for records that have the same priority. The default value is 0.
    data str
    The IP address or a hostname of a domain's resource record. Fully qualified host and domain name data must end with the . character.
    domain_id float
    The ID for the domain associated with the resource record.
    host str
    The host defined by a resource record. The @ symbol denotes a wildcard.
    type str
    The type of domain resource record. Accepted values are as follows:
    dns_record_id str
    (String) The internal identifier of the domain resource record.
    expire float
    T he duration, expressed in seconds, that a secondary name server (or servers) holds a zone before it is no longer considered authoritative.
    minimum_ttl float
    The duration, expressed in seconds, that a domain's resource records are valid. This is also known as a minimum time to live (TTL), and can be overridden by an individual resource record's TTL.
    mx_priority float
    The priority of the mail exchanger that delivers mail for a domain. This is useful in cases where a domain has more than one mail exchanger. A lower number denotes a higher priority, and mail attempt to deliver through the highest priority exchanger before moving to lower priority exchanger. The default value is 0.
    port float
    SRV records only. The TCP or UDP port on which the service be found.
    priority float
    SRV records only. The priority of the target host. The lowest numerical value is given the highest priority. The default value is 0.
    protocol str
    SRV records only. The protocol of the service that you want to use, such as TCP or UDP.
    refresh float
    The duration expressed in seconds, that a secondary name server waits to check the domain's primary name server for a new copy of a DNS zone. If a zone file has changed, the secondary DNS server updates its copy of the zone to match the primary DNS server's zone.
    responsible_person str
    The email address of the person responsible for a domain. Replace the @ symbol in the address with a .. For example, root@example.org would be expressed as root.example.org..
    retry float
    The duration, expressed in seconds, that the domain's primary name server (or servers) waits before attempting to refresh the domain's zone with the secondary name server. A failed attempt to refresh by a secondary name server triggers the retry action.
    service str
    SRV records only. The symbolic name of the service.
    tags Sequence[str]
    Tags associated with the DNS domain record instance.
    Note Tags are managed locally and not stored on the IBM Cloud Service Endpoint at this moment.
    ttl float
    The time to live (TTL) duration, expressed in seconds, of a resource record. A name server uses TTL to determine how long to cache a resource record. An SOA record's TTL value defines the domain's overall TTL.
    weight float
    SRV records only. A relative weight for records that have the same priority. The default value is 0.
    data String
    The IP address or a hostname of a domain's resource record. Fully qualified host and domain name data must end with the . character.
    domainId Number
    The ID for the domain associated with the resource record.
    host String
    The host defined by a resource record. The @ symbol denotes a wildcard.
    type String
    The type of domain resource record. Accepted values are as follows:
    dnsRecordId String
    (String) The internal identifier of the domain resource record.
    expire Number
    T he duration, expressed in seconds, that a secondary name server (or servers) holds a zone before it is no longer considered authoritative.
    minimumTtl Number
    The duration, expressed in seconds, that a domain's resource records are valid. This is also known as a minimum time to live (TTL), and can be overridden by an individual resource record's TTL.
    mxPriority Number
    The priority of the mail exchanger that delivers mail for a domain. This is useful in cases where a domain has more than one mail exchanger. A lower number denotes a higher priority, and mail attempt to deliver through the highest priority exchanger before moving to lower priority exchanger. The default value is 0.
    port Number
    SRV records only. The TCP or UDP port on which the service be found.
    priority Number
    SRV records only. The priority of the target host. The lowest numerical value is given the highest priority. The default value is 0.
    protocol String
    SRV records only. The protocol of the service that you want to use, such as TCP or UDP.
    refresh Number
    The duration expressed in seconds, that a secondary name server waits to check the domain's primary name server for a new copy of a DNS zone. If a zone file has changed, the secondary DNS server updates its copy of the zone to match the primary DNS server's zone.
    responsiblePerson String
    The email address of the person responsible for a domain. Replace the @ symbol in the address with a .. For example, root@example.org would be expressed as root.example.org..
    retry Number
    The duration, expressed in seconds, that the domain's primary name server (or servers) waits before attempting to refresh the domain's zone with the secondary name server. A failed attempt to refresh by a secondary name server triggers the retry action.
    service String
    SRV records only. The symbolic name of the service.
    tags List<String>
    Tags associated with the DNS domain record instance.
    Note Tags are managed locally and not stored on the IBM Cloud Service Endpoint at this moment.
    ttl Number
    The time to live (TTL) duration, expressed in seconds, of a resource record. A name server uses TTL to determine how long to cache a resource record. An SOA record's TTL value defines the domain's overall TTL.
    weight Number
    SRV records only. A relative weight for records that have the same priority. The default value is 0.

    Outputs

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

    Id string
    The provider-assigned unique ID for this managed resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing DnsRecord Resource

    Get an existing DnsRecord 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?: DnsRecordState, opts?: CustomResourceOptions): DnsRecord
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            data: Optional[str] = None,
            dns_record_id: Optional[str] = None,
            domain_id: Optional[float] = None,
            expire: Optional[float] = None,
            host: Optional[str] = None,
            minimum_ttl: Optional[float] = None,
            mx_priority: Optional[float] = None,
            port: Optional[float] = None,
            priority: Optional[float] = None,
            protocol: Optional[str] = None,
            refresh: Optional[float] = None,
            responsible_person: Optional[str] = None,
            retry: Optional[float] = None,
            service: Optional[str] = None,
            tags: Optional[Sequence[str]] = None,
            ttl: Optional[float] = None,
            type: Optional[str] = None,
            weight: Optional[float] = None) -> DnsRecord
    func GetDnsRecord(ctx *Context, name string, id IDInput, state *DnsRecordState, opts ...ResourceOption) (*DnsRecord, error)
    public static DnsRecord Get(string name, Input<string> id, DnsRecordState? state, CustomResourceOptions? opts = null)
    public static DnsRecord get(String name, Output<String> id, DnsRecordState state, CustomResourceOptions options)
    resources:  _:    type: ibm:DnsRecord    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:
    Data string
    The IP address or a hostname of a domain's resource record. Fully qualified host and domain name data must end with the . character.
    DnsRecordId string
    (String) The internal identifier of the domain resource record.
    DomainId double
    The ID for the domain associated with the resource record.
    Expire double
    T he duration, expressed in seconds, that a secondary name server (or servers) holds a zone before it is no longer considered authoritative.
    Host string
    The host defined by a resource record. The @ symbol denotes a wildcard.
    MinimumTtl double
    The duration, expressed in seconds, that a domain's resource records are valid. This is also known as a minimum time to live (TTL), and can be overridden by an individual resource record's TTL.
    MxPriority double
    The priority of the mail exchanger that delivers mail for a domain. This is useful in cases where a domain has more than one mail exchanger. A lower number denotes a higher priority, and mail attempt to deliver through the highest priority exchanger before moving to lower priority exchanger. The default value is 0.
    Port double
    SRV records only. The TCP or UDP port on which the service be found.
    Priority double
    SRV records only. The priority of the target host. The lowest numerical value is given the highest priority. The default value is 0.
    Protocol string
    SRV records only. The protocol of the service that you want to use, such as TCP or UDP.
    Refresh double
    The duration expressed in seconds, that a secondary name server waits to check the domain's primary name server for a new copy of a DNS zone. If a zone file has changed, the secondary DNS server updates its copy of the zone to match the primary DNS server's zone.
    ResponsiblePerson string
    The email address of the person responsible for a domain. Replace the @ symbol in the address with a .. For example, root@example.org would be expressed as root.example.org..
    Retry double
    The duration, expressed in seconds, that the domain's primary name server (or servers) waits before attempting to refresh the domain's zone with the secondary name server. A failed attempt to refresh by a secondary name server triggers the retry action.
    Service string
    SRV records only. The symbolic name of the service.
    Tags List<string>
    Tags associated with the DNS domain record instance.
    Note Tags are managed locally and not stored on the IBM Cloud Service Endpoint at this moment.
    Ttl double
    The time to live (TTL) duration, expressed in seconds, of a resource record. A name server uses TTL to determine how long to cache a resource record. An SOA record's TTL value defines the domain's overall TTL.
    Type string
    The type of domain resource record. Accepted values are as follows:
    Weight double
    SRV records only. A relative weight for records that have the same priority. The default value is 0.
    Data string
    The IP address or a hostname of a domain's resource record. Fully qualified host and domain name data must end with the . character.
    DnsRecordId string
    (String) The internal identifier of the domain resource record.
    DomainId float64
    The ID for the domain associated with the resource record.
    Expire float64
    T he duration, expressed in seconds, that a secondary name server (or servers) holds a zone before it is no longer considered authoritative.
    Host string
    The host defined by a resource record. The @ symbol denotes a wildcard.
    MinimumTtl float64
    The duration, expressed in seconds, that a domain's resource records are valid. This is also known as a minimum time to live (TTL), and can be overridden by an individual resource record's TTL.
    MxPriority float64
    The priority of the mail exchanger that delivers mail for a domain. This is useful in cases where a domain has more than one mail exchanger. A lower number denotes a higher priority, and mail attempt to deliver through the highest priority exchanger before moving to lower priority exchanger. The default value is 0.
    Port float64
    SRV records only. The TCP or UDP port on which the service be found.
    Priority float64
    SRV records only. The priority of the target host. The lowest numerical value is given the highest priority. The default value is 0.
    Protocol string
    SRV records only. The protocol of the service that you want to use, such as TCP or UDP.
    Refresh float64
    The duration expressed in seconds, that a secondary name server waits to check the domain's primary name server for a new copy of a DNS zone. If a zone file has changed, the secondary DNS server updates its copy of the zone to match the primary DNS server's zone.
    ResponsiblePerson string
    The email address of the person responsible for a domain. Replace the @ symbol in the address with a .. For example, root@example.org would be expressed as root.example.org..
    Retry float64
    The duration, expressed in seconds, that the domain's primary name server (or servers) waits before attempting to refresh the domain's zone with the secondary name server. A failed attempt to refresh by a secondary name server triggers the retry action.
    Service string
    SRV records only. The symbolic name of the service.
    Tags []string
    Tags associated with the DNS domain record instance.
    Note Tags are managed locally and not stored on the IBM Cloud Service Endpoint at this moment.
    Ttl float64
    The time to live (TTL) duration, expressed in seconds, of a resource record. A name server uses TTL to determine how long to cache a resource record. An SOA record's TTL value defines the domain's overall TTL.
    Type string
    The type of domain resource record. Accepted values are as follows:
    Weight float64
    SRV records only. A relative weight for records that have the same priority. The default value is 0.
    data String
    The IP address or a hostname of a domain's resource record. Fully qualified host and domain name data must end with the . character.
    dnsRecordId String
    (String) The internal identifier of the domain resource record.
    domainId Double
    The ID for the domain associated with the resource record.
    expire Double
    T he duration, expressed in seconds, that a secondary name server (or servers) holds a zone before it is no longer considered authoritative.
    host String
    The host defined by a resource record. The @ symbol denotes a wildcard.
    minimumTtl Double
    The duration, expressed in seconds, that a domain's resource records are valid. This is also known as a minimum time to live (TTL), and can be overridden by an individual resource record's TTL.
    mxPriority Double
    The priority of the mail exchanger that delivers mail for a domain. This is useful in cases where a domain has more than one mail exchanger. A lower number denotes a higher priority, and mail attempt to deliver through the highest priority exchanger before moving to lower priority exchanger. The default value is 0.
    port Double
    SRV records only. The TCP or UDP port on which the service be found.
    priority Double
    SRV records only. The priority of the target host. The lowest numerical value is given the highest priority. The default value is 0.
    protocol String
    SRV records only. The protocol of the service that you want to use, such as TCP or UDP.
    refresh Double
    The duration expressed in seconds, that a secondary name server waits to check the domain's primary name server for a new copy of a DNS zone. If a zone file has changed, the secondary DNS server updates its copy of the zone to match the primary DNS server's zone.
    responsiblePerson String
    The email address of the person responsible for a domain. Replace the @ symbol in the address with a .. For example, root@example.org would be expressed as root.example.org..
    retry Double
    The duration, expressed in seconds, that the domain's primary name server (or servers) waits before attempting to refresh the domain's zone with the secondary name server. A failed attempt to refresh by a secondary name server triggers the retry action.
    service String
    SRV records only. The symbolic name of the service.
    tags List<String>
    Tags associated with the DNS domain record instance.
    Note Tags are managed locally and not stored on the IBM Cloud Service Endpoint at this moment.
    ttl Double
    The time to live (TTL) duration, expressed in seconds, of a resource record. A name server uses TTL to determine how long to cache a resource record. An SOA record's TTL value defines the domain's overall TTL.
    type String
    The type of domain resource record. Accepted values are as follows:
    weight Double
    SRV records only. A relative weight for records that have the same priority. The default value is 0.
    data string
    The IP address or a hostname of a domain's resource record. Fully qualified host and domain name data must end with the . character.
    dnsRecordId string
    (String) The internal identifier of the domain resource record.
    domainId number
    The ID for the domain associated with the resource record.
    expire number
    T he duration, expressed in seconds, that a secondary name server (or servers) holds a zone before it is no longer considered authoritative.
    host string
    The host defined by a resource record. The @ symbol denotes a wildcard.
    minimumTtl number
    The duration, expressed in seconds, that a domain's resource records are valid. This is also known as a minimum time to live (TTL), and can be overridden by an individual resource record's TTL.
    mxPriority number
    The priority of the mail exchanger that delivers mail for a domain. This is useful in cases where a domain has more than one mail exchanger. A lower number denotes a higher priority, and mail attempt to deliver through the highest priority exchanger before moving to lower priority exchanger. The default value is 0.
    port number
    SRV records only. The TCP or UDP port on which the service be found.
    priority number
    SRV records only. The priority of the target host. The lowest numerical value is given the highest priority. The default value is 0.
    protocol string
    SRV records only. The protocol of the service that you want to use, such as TCP or UDP.
    refresh number
    The duration expressed in seconds, that a secondary name server waits to check the domain's primary name server for a new copy of a DNS zone. If a zone file has changed, the secondary DNS server updates its copy of the zone to match the primary DNS server's zone.
    responsiblePerson string
    The email address of the person responsible for a domain. Replace the @ symbol in the address with a .. For example, root@example.org would be expressed as root.example.org..
    retry number
    The duration, expressed in seconds, that the domain's primary name server (or servers) waits before attempting to refresh the domain's zone with the secondary name server. A failed attempt to refresh by a secondary name server triggers the retry action.
    service string
    SRV records only. The symbolic name of the service.
    tags string[]
    Tags associated with the DNS domain record instance.
    Note Tags are managed locally and not stored on the IBM Cloud Service Endpoint at this moment.
    ttl number
    The time to live (TTL) duration, expressed in seconds, of a resource record. A name server uses TTL to determine how long to cache a resource record. An SOA record's TTL value defines the domain's overall TTL.
    type string
    The type of domain resource record. Accepted values are as follows:
    weight number
    SRV records only. A relative weight for records that have the same priority. The default value is 0.
    data str
    The IP address or a hostname of a domain's resource record. Fully qualified host and domain name data must end with the . character.
    dns_record_id str
    (String) The internal identifier of the domain resource record.
    domain_id float
    The ID for the domain associated with the resource record.
    expire float
    T he duration, expressed in seconds, that a secondary name server (or servers) holds a zone before it is no longer considered authoritative.
    host str
    The host defined by a resource record. The @ symbol denotes a wildcard.
    minimum_ttl float
    The duration, expressed in seconds, that a domain's resource records are valid. This is also known as a minimum time to live (TTL), and can be overridden by an individual resource record's TTL.
    mx_priority float
    The priority of the mail exchanger that delivers mail for a domain. This is useful in cases where a domain has more than one mail exchanger. A lower number denotes a higher priority, and mail attempt to deliver through the highest priority exchanger before moving to lower priority exchanger. The default value is 0.
    port float
    SRV records only. The TCP or UDP port on which the service be found.
    priority float
    SRV records only. The priority of the target host. The lowest numerical value is given the highest priority. The default value is 0.
    protocol str
    SRV records only. The protocol of the service that you want to use, such as TCP or UDP.
    refresh float
    The duration expressed in seconds, that a secondary name server waits to check the domain's primary name server for a new copy of a DNS zone. If a zone file has changed, the secondary DNS server updates its copy of the zone to match the primary DNS server's zone.
    responsible_person str
    The email address of the person responsible for a domain. Replace the @ symbol in the address with a .. For example, root@example.org would be expressed as root.example.org..
    retry float
    The duration, expressed in seconds, that the domain's primary name server (or servers) waits before attempting to refresh the domain's zone with the secondary name server. A failed attempt to refresh by a secondary name server triggers the retry action.
    service str
    SRV records only. The symbolic name of the service.
    tags Sequence[str]
    Tags associated with the DNS domain record instance.
    Note Tags are managed locally and not stored on the IBM Cloud Service Endpoint at this moment.
    ttl float
    The time to live (TTL) duration, expressed in seconds, of a resource record. A name server uses TTL to determine how long to cache a resource record. An SOA record's TTL value defines the domain's overall TTL.
    type str
    The type of domain resource record. Accepted values are as follows:
    weight float
    SRV records only. A relative weight for records that have the same priority. The default value is 0.
    data String
    The IP address or a hostname of a domain's resource record. Fully qualified host and domain name data must end with the . character.
    dnsRecordId String
    (String) The internal identifier of the domain resource record.
    domainId Number
    The ID for the domain associated with the resource record.
    expire Number
    T he duration, expressed in seconds, that a secondary name server (or servers) holds a zone before it is no longer considered authoritative.
    host String
    The host defined by a resource record. The @ symbol denotes a wildcard.
    minimumTtl Number
    The duration, expressed in seconds, that a domain's resource records are valid. This is also known as a minimum time to live (TTL), and can be overridden by an individual resource record's TTL.
    mxPriority Number
    The priority of the mail exchanger that delivers mail for a domain. This is useful in cases where a domain has more than one mail exchanger. A lower number denotes a higher priority, and mail attempt to deliver through the highest priority exchanger before moving to lower priority exchanger. The default value is 0.
    port Number
    SRV records only. The TCP or UDP port on which the service be found.
    priority Number
    SRV records only. The priority of the target host. The lowest numerical value is given the highest priority. The default value is 0.
    protocol String
    SRV records only. The protocol of the service that you want to use, such as TCP or UDP.
    refresh Number
    The duration expressed in seconds, that a secondary name server waits to check the domain's primary name server for a new copy of a DNS zone. If a zone file has changed, the secondary DNS server updates its copy of the zone to match the primary DNS server's zone.
    responsiblePerson String
    The email address of the person responsible for a domain. Replace the @ symbol in the address with a .. For example, root@example.org would be expressed as root.example.org..
    retry Number
    The duration, expressed in seconds, that the domain's primary name server (or servers) waits before attempting to refresh the domain's zone with the secondary name server. A failed attempt to refresh by a secondary name server triggers the retry action.
    service String
    SRV records only. The symbolic name of the service.
    tags List<String>
    Tags associated with the DNS domain record instance.
    Note Tags are managed locally and not stored on the IBM Cloud Service Endpoint at this moment.
    ttl Number
    The time to live (TTL) duration, expressed in seconds, of a resource record. A name server uses TTL to determine how long to cache a resource record. An SOA record's TTL value defines the domain's overall TTL.
    type String
    The type of domain resource record. Accepted values are as follows:
    weight Number
    SRV records only. A relative weight for records that have the same priority. The default value is 0.

    Package Details

    Repository
    ibm ibm-cloud/terraform-provider-ibm
    License
    Notes
    This Pulumi package is based on the ibm Terraform Provider.
    ibm logo
    ibm 1.78.0 published on Wednesday, Apr 30, 2025 by ibm-cloud