Alibaba Cloud v3.75.0 published on Friday, Mar 7, 2025 by Pulumi
alicloud.dns.getAlidnsRecords
Explore with Pulumi AI
This data source provides a list of Alidns Domain Records in an Alibaba Cloud account according to the specified filters.
NOTE: Available since v1.86.0.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const recordsDs = alicloud.dns.getAlidnsRecords({
    domainName: "xiaozhu.top",
    ids: ["1978593525779****"],
    type: "A",
    outputFile: "records.txt",
});
export const firstRecordId = recordsDs.then(recordsDs => recordsDs.records?.[0]?.recordId);
import pulumi
import pulumi_alicloud as alicloud
records_ds = alicloud.dns.get_alidns_records(domain_name="xiaozhu.top",
    ids=["1978593525779****"],
    type="A",
    output_file="records.txt")
pulumi.export("firstRecordId", records_ds.records[0].record_id)
package main
import (
	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/dns"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		recordsDs, err := dns.GetAlidnsRecords(ctx, &dns.GetAlidnsRecordsArgs{
			DomainName: "xiaozhu.top",
			Ids: []string{
				"1978593525779****",
			},
			Type:       pulumi.StringRef("A"),
			OutputFile: pulumi.StringRef("records.txt"),
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("firstRecordId", recordsDs.Records[0].RecordId)
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
return await Deployment.RunAsync(() => 
{
    var recordsDs = AliCloud.Dns.GetAlidnsRecords.Invoke(new()
    {
        DomainName = "xiaozhu.top",
        Ids = new[]
        {
            "1978593525779****",
        },
        Type = "A",
        OutputFile = "records.txt",
    });
    return new Dictionary<string, object?>
    {
        ["firstRecordId"] = recordsDs.Apply(getAlidnsRecordsResult => getAlidnsRecordsResult.Records[0]?.RecordId),
    };
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.dns.DnsFunctions;
import com.pulumi.alicloud.dns.inputs.GetAlidnsRecordsArgs;
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) {
        final var recordsDs = DnsFunctions.getAlidnsRecords(GetAlidnsRecordsArgs.builder()
            .domainName("xiaozhu.top")
            .ids("1978593525779****")
            .type("A")
            .outputFile("records.txt")
            .build());
        ctx.export("firstRecordId", recordsDs.applyValue(getAlidnsRecordsResult -> getAlidnsRecordsResult.records()[0].recordId()));
    }
}
variables:
  recordsDs:
    fn::invoke:
      function: alicloud:dns:getAlidnsRecords
      arguments:
        domainName: xiaozhu.top
        ids:
          - 1978593525779****
        type: A
        outputFile: records.txt
outputs:
  firstRecordId: ${recordsDs.records[0].recordId}
Using getAlidnsRecords
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getAlidnsRecords(args: GetAlidnsRecordsArgs, opts?: InvokeOptions): Promise<GetAlidnsRecordsResult>
function getAlidnsRecordsOutput(args: GetAlidnsRecordsOutputArgs, opts?: InvokeOptions): Output<GetAlidnsRecordsResult>def get_alidns_records(direction: Optional[str] = None,
                       domain_name: Optional[str] = None,
                       group_id: Optional[int] = None,
                       ids: Optional[Sequence[str]] = None,
                       key_word: Optional[str] = None,
                       lang: Optional[str] = None,
                       line: Optional[str] = None,
                       order_by: Optional[str] = None,
                       output_file: Optional[str] = None,
                       rr_key_word: Optional[str] = None,
                       rr_regex: Optional[str] = None,
                       search_mode: Optional[str] = None,
                       status: Optional[str] = None,
                       type: Optional[str] = None,
                       type_key_word: Optional[str] = None,
                       value_key_word: Optional[str] = None,
                       value_regex: Optional[str] = None,
                       opts: Optional[InvokeOptions] = None) -> GetAlidnsRecordsResult
def get_alidns_records_output(direction: Optional[pulumi.Input[str]] = None,
                       domain_name: Optional[pulumi.Input[str]] = None,
                       group_id: Optional[pulumi.Input[int]] = None,
                       ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                       key_word: Optional[pulumi.Input[str]] = None,
                       lang: Optional[pulumi.Input[str]] = None,
                       line: Optional[pulumi.Input[str]] = None,
                       order_by: Optional[pulumi.Input[str]] = None,
                       output_file: Optional[pulumi.Input[str]] = None,
                       rr_key_word: Optional[pulumi.Input[str]] = None,
                       rr_regex: Optional[pulumi.Input[str]] = None,
                       search_mode: Optional[pulumi.Input[str]] = None,
                       status: Optional[pulumi.Input[str]] = None,
                       type: Optional[pulumi.Input[str]] = None,
                       type_key_word: Optional[pulumi.Input[str]] = None,
                       value_key_word: Optional[pulumi.Input[str]] = None,
                       value_regex: Optional[pulumi.Input[str]] = None,
                       opts: Optional[InvokeOptions] = None) -> Output[GetAlidnsRecordsResult]func GetAlidnsRecords(ctx *Context, args *GetAlidnsRecordsArgs, opts ...InvokeOption) (*GetAlidnsRecordsResult, error)
func GetAlidnsRecordsOutput(ctx *Context, args *GetAlidnsRecordsOutputArgs, opts ...InvokeOption) GetAlidnsRecordsResultOutput> Note: This function is named GetAlidnsRecords in the Go SDK.
public static class GetAlidnsRecords 
{
    public static Task<GetAlidnsRecordsResult> InvokeAsync(GetAlidnsRecordsArgs args, InvokeOptions? opts = null)
    public static Output<GetAlidnsRecordsResult> Invoke(GetAlidnsRecordsInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetAlidnsRecordsResult> getAlidnsRecords(GetAlidnsRecordsArgs args, InvokeOptions options)
public static Output<GetAlidnsRecordsResult> getAlidnsRecords(GetAlidnsRecordsArgs args, InvokeOptions options)
fn::invoke:
  function: alicloud:dns/getAlidnsRecords:getAlidnsRecords
  arguments:
    # arguments dictionaryThe following arguments are supported:
- DomainName string
- The domain name associated to the records.
- Direction string
- Sorting direction. Valid values: DESC,ASC. Default toAESC.
- GroupId int
- Domain name group ID.
- Ids List<string>
- A list of record IDs.
- KeyWord string
- Keywords.
- Lang string
- User language.
- Line string
- ISP line. For checking all resolution lines enumeration please visit Alibaba Cloud DNS doc
- OrderBy string
- Sort by. Sort from newest to oldest according to the time added by resolution.
- OutputFile string
- File name where to save data source results (after running pulumi preview).
- RrKey stringWord 
- The keywords recorded by the host are searched according to the %RRKeyWord%mode, and are not case sensitive.
- RrRegex string
- Host record regex.
- SearchMode string
- Search mode, Valid values: LIKE,EXACT,ADVANCED,LIKE(fuzzy),EXACT(accurate) search supports KeyWord field,ADVANCED(advanced) mode supports other fields.
- Status string
- Record status. Valid values: ENABLEandDISABLE.
- Type string
- Record type. Valid values: A,NS,MX,TXT,CNAME,SRV,AAAA,REDIRECT_URL,FORWORD_URL.
- TypeKey stringWord 
- Analyze type keywords, search by full match, not case sensitive.
- ValueKey stringWord 
- The keywords of the recorded value are searched according to the %ValueKeyWord%mode, and are not case sensitive.
- ValueRegex string
- Host record value regex.
- DomainName string
- The domain name associated to the records.
- Direction string
- Sorting direction. Valid values: DESC,ASC. Default toAESC.
- GroupId int
- Domain name group ID.
- Ids []string
- A list of record IDs.
- KeyWord string
- Keywords.
- Lang string
- User language.
- Line string
- ISP line. For checking all resolution lines enumeration please visit Alibaba Cloud DNS doc
- OrderBy string
- Sort by. Sort from newest to oldest according to the time added by resolution.
- OutputFile string
- File name where to save data source results (after running pulumi preview).
- RrKey stringWord 
- The keywords recorded by the host are searched according to the %RRKeyWord%mode, and are not case sensitive.
- RrRegex string
- Host record regex.
- SearchMode string
- Search mode, Valid values: LIKE,EXACT,ADVANCED,LIKE(fuzzy),EXACT(accurate) search supports KeyWord field,ADVANCED(advanced) mode supports other fields.
- Status string
- Record status. Valid values: ENABLEandDISABLE.
- Type string
- Record type. Valid values: A,NS,MX,TXT,CNAME,SRV,AAAA,REDIRECT_URL,FORWORD_URL.
- TypeKey stringWord 
- Analyze type keywords, search by full match, not case sensitive.
- ValueKey stringWord 
- The keywords of the recorded value are searched according to the %ValueKeyWord%mode, and are not case sensitive.
- ValueRegex string
- Host record value regex.
- domainName String
- The domain name associated to the records.
- direction String
- Sorting direction. Valid values: DESC,ASC. Default toAESC.
- groupId Integer
- Domain name group ID.
- ids List<String>
- A list of record IDs.
- keyWord String
- Keywords.
- lang String
- User language.
- line String
- ISP line. For checking all resolution lines enumeration please visit Alibaba Cloud DNS doc
- orderBy String
- Sort by. Sort from newest to oldest according to the time added by resolution.
- outputFile String
- File name where to save data source results (after running pulumi preview).
- rrKey StringWord 
- The keywords recorded by the host are searched according to the %RRKeyWord%mode, and are not case sensitive.
- rrRegex String
- Host record regex.
- searchMode String
- Search mode, Valid values: LIKE,EXACT,ADVANCED,LIKE(fuzzy),EXACT(accurate) search supports KeyWord field,ADVANCED(advanced) mode supports other fields.
- status String
- Record status. Valid values: ENABLEandDISABLE.
- type String
- Record type. Valid values: A,NS,MX,TXT,CNAME,SRV,AAAA,REDIRECT_URL,FORWORD_URL.
- typeKey StringWord 
- Analyze type keywords, search by full match, not case sensitive.
- valueKey StringWord 
- The keywords of the recorded value are searched according to the %ValueKeyWord%mode, and are not case sensitive.
- valueRegex String
- Host record value regex.
- domainName string
- The domain name associated to the records.
- direction string
- Sorting direction. Valid values: DESC,ASC. Default toAESC.
- groupId number
- Domain name group ID.
- ids string[]
- A list of record IDs.
- keyWord string
- Keywords.
- lang string
- User language.
- line string
- ISP line. For checking all resolution lines enumeration please visit Alibaba Cloud DNS doc
- orderBy string
- Sort by. Sort from newest to oldest according to the time added by resolution.
- outputFile string
- File name where to save data source results (after running pulumi preview).
- rrKey stringWord 
- The keywords recorded by the host are searched according to the %RRKeyWord%mode, and are not case sensitive.
- rrRegex string
- Host record regex.
- searchMode string
- Search mode, Valid values: LIKE,EXACT,ADVANCED,LIKE(fuzzy),EXACT(accurate) search supports KeyWord field,ADVANCED(advanced) mode supports other fields.
- status string
- Record status. Valid values: ENABLEandDISABLE.
- type string
- Record type. Valid values: A,NS,MX,TXT,CNAME,SRV,AAAA,REDIRECT_URL,FORWORD_URL.
- typeKey stringWord 
- Analyze type keywords, search by full match, not case sensitive.
- valueKey stringWord 
- The keywords of the recorded value are searched according to the %ValueKeyWord%mode, and are not case sensitive.
- valueRegex string
- Host record value regex.
- domain_name str
- The domain name associated to the records.
- direction str
- Sorting direction. Valid values: DESC,ASC. Default toAESC.
- group_id int
- Domain name group ID.
- ids Sequence[str]
- A list of record IDs.
- key_word str
- Keywords.
- lang str
- User language.
- line str
- ISP line. For checking all resolution lines enumeration please visit Alibaba Cloud DNS doc
- order_by str
- Sort by. Sort from newest to oldest according to the time added by resolution.
- output_file str
- File name where to save data source results (after running pulumi preview).
- rr_key_ strword 
- The keywords recorded by the host are searched according to the %RRKeyWord%mode, and are not case sensitive.
- rr_regex str
- Host record regex.
- search_mode str
- Search mode, Valid values: LIKE,EXACT,ADVANCED,LIKE(fuzzy),EXACT(accurate) search supports KeyWord field,ADVANCED(advanced) mode supports other fields.
- status str
- Record status. Valid values: ENABLEandDISABLE.
- type str
- Record type. Valid values: A,NS,MX,TXT,CNAME,SRV,AAAA,REDIRECT_URL,FORWORD_URL.
- type_key_ strword 
- Analyze type keywords, search by full match, not case sensitive.
- value_key_ strword 
- The keywords of the recorded value are searched according to the %ValueKeyWord%mode, and are not case sensitive.
- value_regex str
- Host record value regex.
- domainName String
- The domain name associated to the records.
- direction String
- Sorting direction. Valid values: DESC,ASC. Default toAESC.
- groupId Number
- Domain name group ID.
- ids List<String>
- A list of record IDs.
- keyWord String
- Keywords.
- lang String
- User language.
- line String
- ISP line. For checking all resolution lines enumeration please visit Alibaba Cloud DNS doc
- orderBy String
- Sort by. Sort from newest to oldest according to the time added by resolution.
- outputFile String
- File name where to save data source results (after running pulumi preview).
- rrKey StringWord 
- The keywords recorded by the host are searched according to the %RRKeyWord%mode, and are not case sensitive.
- rrRegex String
- Host record regex.
- searchMode String
- Search mode, Valid values: LIKE,EXACT,ADVANCED,LIKE(fuzzy),EXACT(accurate) search supports KeyWord field,ADVANCED(advanced) mode supports other fields.
- status String
- Record status. Valid values: ENABLEandDISABLE.
- type String
- Record type. Valid values: A,NS,MX,TXT,CNAME,SRV,AAAA,REDIRECT_URL,FORWORD_URL.
- typeKey StringWord 
- Analyze type keywords, search by full match, not case sensitive.
- valueKey StringWord 
- The keywords of the recorded value are searched according to the %ValueKeyWord%mode, and are not case sensitive.
- valueRegex String
- Host record value regex.
getAlidnsRecords Result
The following output properties are available:
- DomainName string
- Name of the domain record belongs to.
- Id string
- The provider-assigned unique ID for this managed resource.
- Ids List<string>
- A list of record IDs.
- Records
List<Pulumi.Ali Cloud. Dns. Outputs. Get Alidns Records Record> 
- A list of records. Each element contains the following attributes:
- Direction string
- GroupId int
- KeyWord string
- Lang string
- Line string
- ISP line of the record.
- OrderBy string
- OutputFile string
- RrKey stringWord 
- RrRegex string
- SearchMode string
- Status string
- Status of the record.
- Type string
- Type of the record.
- TypeKey stringWord 
- ValueKey stringWord 
- ValueRegex string
- DomainName string
- Name of the domain record belongs to.
- Id string
- The provider-assigned unique ID for this managed resource.
- Ids []string
- A list of record IDs.
- Records
[]GetAlidns Records Record 
- A list of records. Each element contains the following attributes:
- Direction string
- GroupId int
- KeyWord string
- Lang string
- Line string
- ISP line of the record.
- OrderBy string
- OutputFile string
- RrKey stringWord 
- RrRegex string
- SearchMode string
- Status string
- Status of the record.
- Type string
- Type of the record.
- TypeKey stringWord 
- ValueKey stringWord 
- ValueRegex string
- domainName String
- Name of the domain record belongs to.
- id String
- The provider-assigned unique ID for this managed resource.
- ids List<String>
- A list of record IDs.
- records
List<GetAli Records Record> 
- A list of records. Each element contains the following attributes:
- direction String
- groupId Integer
- keyWord String
- lang String
- line String
- ISP line of the record.
- orderBy String
- outputFile String
- rrKey StringWord 
- rrRegex String
- searchMode String
- status String
- Status of the record.
- type String
- Type of the record.
- typeKey StringWord 
- valueKey StringWord 
- valueRegex String
- domainName string
- Name of the domain record belongs to.
- id string
- The provider-assigned unique ID for this managed resource.
- ids string[]
- A list of record IDs.
- records
GetAlidns Records Record[] 
- A list of records. Each element contains the following attributes:
- direction string
- groupId number
- keyWord string
- lang string
- line string
- ISP line of the record.
- orderBy string
- outputFile string
- rrKey stringWord 
- rrRegex string
- searchMode string
- status string
- Status of the record.
- type string
- Type of the record.
- typeKey stringWord 
- valueKey stringWord 
- valueRegex string
- domain_name str
- Name of the domain record belongs to.
- id str
- The provider-assigned unique ID for this managed resource.
- ids Sequence[str]
- A list of record IDs.
- records
Sequence[GetAlidns Records Record] 
- A list of records. Each element contains the following attributes:
- direction str
- group_id int
- key_word str
- lang str
- line str
- ISP line of the record.
- order_by str
- output_file str
- rr_key_ strword 
- rr_regex str
- search_mode str
- status str
- Status of the record.
- type str
- Type of the record.
- type_key_ strword 
- value_key_ strword 
- value_regex str
- domainName String
- Name of the domain record belongs to.
- id String
- The provider-assigned unique ID for this managed resource.
- ids List<String>
- A list of record IDs.
- records List<Property Map>
- A list of records. Each element contains the following attributes:
- direction String
- groupId Number
- keyWord String
- lang String
- line String
- ISP line of the record.
- orderBy String
- outputFile String
- rrKey StringWord 
- rrRegex String
- searchMode String
- status String
- Status of the record.
- type String
- Type of the record.
- typeKey StringWord 
- valueKey StringWord 
- valueRegex String
Supporting Types
GetAlidnsRecordsRecord   
- DomainName string
- The domain name associated to the records.
- Id string
- ID of the resource.
- Line string
- ISP line. For checking all resolution lines enumeration please visit Alibaba Cloud DNS doc
- Locked bool
- Indicates whether the record is locked.
- Priority int
- Priority of the MXrecord.
- RecordId string
- ID of the record.
- Remark string
- The remark of the domain record. NOTE: Available in 1.144.0+.
- Rr string
- Host record of the domain.
- Status string
- Record status. Valid values: ENABLEandDISABLE.
- Ttl int
- TTL of the record.
- Type string
- Record type. Valid values: A,NS,MX,TXT,CNAME,SRV,AAAA,REDIRECT_URL,FORWORD_URL.
- Value string
- Host record value of the domain.
- DomainName string
- The domain name associated to the records.
- Id string
- ID of the resource.
- Line string
- ISP line. For checking all resolution lines enumeration please visit Alibaba Cloud DNS doc
- Locked bool
- Indicates whether the record is locked.
- Priority int
- Priority of the MXrecord.
- RecordId string
- ID of the record.
- Remark string
- The remark of the domain record. NOTE: Available in 1.144.0+.
- Rr string
- Host record of the domain.
- Status string
- Record status. Valid values: ENABLEandDISABLE.
- Ttl int
- TTL of the record.
- Type string
- Record type. Valid values: A,NS,MX,TXT,CNAME,SRV,AAAA,REDIRECT_URL,FORWORD_URL.
- Value string
- Host record value of the domain.
- domainName String
- The domain name associated to the records.
- id String
- ID of the resource.
- line String
- ISP line. For checking all resolution lines enumeration please visit Alibaba Cloud DNS doc
- locked Boolean
- Indicates whether the record is locked.
- priority Integer
- Priority of the MXrecord.
- recordId String
- ID of the record.
- remark String
- The remark of the domain record. NOTE: Available in 1.144.0+.
- rr String
- Host record of the domain.
- status String
- Record status. Valid values: ENABLEandDISABLE.
- ttl Integer
- TTL of the record.
- type String
- Record type. Valid values: A,NS,MX,TXT,CNAME,SRV,AAAA,REDIRECT_URL,FORWORD_URL.
- value String
- Host record value of the domain.
- domainName string
- The domain name associated to the records.
- id string
- ID of the resource.
- line string
- ISP line. For checking all resolution lines enumeration please visit Alibaba Cloud DNS doc
- locked boolean
- Indicates whether the record is locked.
- priority number
- Priority of the MXrecord.
- recordId string
- ID of the record.
- remark string
- The remark of the domain record. NOTE: Available in 1.144.0+.
- rr string
- Host record of the domain.
- status string
- Record status. Valid values: ENABLEandDISABLE.
- ttl number
- TTL of the record.
- type string
- Record type. Valid values: A,NS,MX,TXT,CNAME,SRV,AAAA,REDIRECT_URL,FORWORD_URL.
- value string
- Host record value of the domain.
- domain_name str
- The domain name associated to the records.
- id str
- ID of the resource.
- line str
- ISP line. For checking all resolution lines enumeration please visit Alibaba Cloud DNS doc
- locked bool
- Indicates whether the record is locked.
- priority int
- Priority of the MXrecord.
- record_id str
- ID of the record.
- remark str
- The remark of the domain record. NOTE: Available in 1.144.0+.
- rr str
- Host record of the domain.
- status str
- Record status. Valid values: ENABLEandDISABLE.
- ttl int
- TTL of the record.
- type str
- Record type. Valid values: A,NS,MX,TXT,CNAME,SRV,AAAA,REDIRECT_URL,FORWORD_URL.
- value str
- Host record value of the domain.
- domainName String
- The domain name associated to the records.
- id String
- ID of the resource.
- line String
- ISP line. For checking all resolution lines enumeration please visit Alibaba Cloud DNS doc
- locked Boolean
- Indicates whether the record is locked.
- priority Number
- Priority of the MXrecord.
- recordId String
- ID of the record.
- remark String
- The remark of the domain record. NOTE: Available in 1.144.0+.
- rr String
- Host record of the domain.
- status String
- Record status. Valid values: ENABLEandDISABLE.
- ttl Number
- TTL of the record.
- type String
- Record type. Valid values: A,NS,MX,TXT,CNAME,SRV,AAAA,REDIRECT_URL,FORWORD_URL.
- value String
- Host record value of the domain.
Package Details
- Repository
- Alibaba Cloud pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the alicloudTerraform Provider.