DNS.LookupRecord
Skip to content
mnscript
DomainRecord DNS.LookupRecord(string, string) 

Description ​

Retrieves a domain record from a domain. See https://portal.civilnetworks.net/maxnet/domains for more information

Arguments ​

string - The domain name to lookup.
string - The type of record ( IP, TXT, etc.. )

Returns ​

DomainRecord - The domain record, or null if not found

Example ​

msc
using Console;
using System;
using Util;
using DNS;

// Looks up a domain record on a domain, then displays its value.
// This uses the DNS cache so you will need to wait a few minutes after changing your domain records.

string domainName = "mn.mnscript.com";
string recordType = "TXT";

DomainRecord record = DNS.LookupRecord(domainName, recordType);

if (Util.IsNull(record)) {
    Console.WriteLine("Domain record not found");
} else {
    Console.WriteLine("Domain record value: "..record.GetValue());
    Console.WriteLine("Domain record name: "..record.GetName());
    Console.WriteLine("Domain record type: "..record.GetType());
    Console.WriteLine("Domain record TTL: "..record.GetTTL());
}