freenom

package
v0.0.0-...-fe2c93c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 9, 2020 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RecordTypeA     string = "A"     // 将主机名(或域名)指向一个 IPv4 地址
	RecordTypeAAAA  string = "AAAA"  // 将主机名(或域名)指向一个 IPv6 地址
	RecordTypeCNAME string = "CNAME" // 别名记录,如果将域名指向一个域名,实现与被指向域名相同的访问效果,需要增加 CNAME 记录
	RecordTypeLOC   string = "LOC"   // Location Information,位置记录,将一个域名指定地理位置
	RecordTypeMX    string = "MX"    // 邮件交换记录,用于指定负责处理发往收件人域名的邮件服务器
	RecordTypeNAPTR string = "NAPTR" // 命名管理指针,允许基于正则表达式的域名重写使其能够作为 URI、进一步域名查找等。主要是为 SIP 协议提供 DNS 服务
	RecordTypeRP    string = "RP"    // Responsible Person 负责人,有关域名负责人的信息,电邮地址的 @ 通常写为 .。
	RecordTypeTXT   string = "TXT"   // 文本记录,一般指为某个主机名或域名设置的说明。一般做某种验证时会用到。
)

Freenom 支持的记录类型 各种记录类型:https://deepzz.com/post/dns-recording-type.html

Variables

This section is empty.

Functions

func AddRecord

func AddRecord(domain string, records []DomainRecord) (err error)

AddRecord 增加域名记录

func CheckFreeDomainPurchasable

func CheckFreeDomainPurchasable(domainPrefix string) (availableDomains []string, err error)

CheckFreeDomainPurchasable 检查免费域名是否可购买 返回 可注册免费域名列表

func DeleteRecord

func DeleteRecord(domain string, record *DomainRecord) (err error)

DeleteRecord 根据参数删除一条域名记录

func DeleteRecordByIndex

func DeleteRecordByIndex(domain string, recordIndex int) (err error)

DeleteRecordByIndex 根据缓存的信息删除一条域名记录

func ListDomains

func ListDomains() (domains map[string]string, err error)

ListDomains 列出用户拥有的所有域名 返回 域名与到期时间

func Login

func Login(user, pwd string) (err error)

Login 登录

func ModifyRecord

func ModifyRecord(domain string, oldRecord, newRecord *DomainRecord) (err error)

ModifyRecord 修改一条域名记录

func PurchaseFreeDomain

func PurchaseFreeDomain(domain string) (err error)

PurchaseFreeDomain 购买免费域名(网站做了 GOOGLE 的反机器人校验,较难突破) 需要注意:Freenom 账号的区域要与发起购买请求的 IP 的地理位置保持一致 可以访问 http://my.freenom.com/details/js/dynamiccountry.php 获取当前 IP 的地区名称英文缩写

func RenewFreeDomain

func RenewFreeDomain(domain string, months int) (renewedDomains map[string]string, err error)

RenewFreeDomain 免费域名续期 返回 免费域名和其续期结果

Types

type DomainInfo

type DomainInfo struct {
	Domain   string
	DomainID string
	RegDate  string
	ExpDate  string
	Records  []*DomainRecord
}

DomainInfo 域名信息

func GetDomainInfo

func GetDomainInfo(domain string) (info *DomainInfo, err error)

GetDomainInfo 获取指定域名的信息 返回 域名信息

type DomainListResult

type DomainListResult struct {
	Status      string          `json:"status"`
	FreeDomains []*DomainStatus `json:"free_domains"`
}

DomainListResult 可购买的免费域名列表

type DomainRecord

type DomainRecord struct {
	Type     string
	Name     string
	TTL      int
	Value    string
	Priority int
}

DomainRecord 域名记录

type DomainStatus

type DomainStatus struct {
	Status   string `json:"status"`
	Domain   string `json:"domain"`
	TLD      string `json:"tld"`
	Type     string `json:"type"`
	IsInCart int    `json:"is_in_cart"`
}

DomainStatus 可购买的域名状态

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL