DNS.BindDomainToIP
Skip to content
mnscript
StringResult DNS.BindDomainToIP(Secret, string) 

Description ​

Binds the terminals IP to the domain by creating an IP record. See https://portal.civilnetworks.net/maxnet/domains for more information

Arguments ​

Secret - Your secret domain key ( see https://portal.civilnetworks.net/maxnet/domains )
string - The domain URL. ( E.G mn.mydomain.com )

Returns ​

StringResult - A StringResult detailing the success or failure of the operation

Example ​

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

// Binds the current terminals IP to the domain
// You must obtain a domain key from the DNS service ( https://portal.civilnetworks.net/maxnet/domains )

Secret domainKeySecret = Secrets.GetSecret("my secret domain key");
string url = "mn.mydomain.com";

StringResult result = DNS.BindDomainToIP(domainKeySecret, url);

if (result.GetResult()) {
    Console.WriteLine("Domain binded!");
} else {
    Console.WriteLine("Error: "..result.GetString());
}