package models import "time" // DNSZone is one Unbound zone: // - zone_type='local': authoritative, records aus dns_records // - zone_type='forward': stub-zone, forward_to ist Komma-Liste // von upstream-IPs (z.B. "10.0.0.53, 8.8.8.8") type DNSZone struct { ID int64 `gorm:"primaryKey" json:"id"` Name string `gorm:"column:name;uniqueIndex" json:"name"` ZoneType string `gorm:"column:zone_type" json:"zone_type"` Description *string `gorm:"column:description" json:"description,omitempty"` ManagedBy string `gorm:"column:managed_by" json:"managed_by"` ForwardTo *string `gorm:"column:forward_to" json:"forward_to,omitempty"` Active bool `gorm:"column:active" json:"active"` CreatedAt time.Time `gorm:"column:created_at" json:"created_at"` UpdatedAt time.Time `gorm:"column:updated_at" json:"updated_at"` } func (DNSZone) TableName() string { return "dns_zones" } // DNSRecord — A/AAAA/CNAME/TXT/MX/SRV/NS/PTR/CAA. Value ist die // RDATA in Textform (für MX: "10 mail.example.com"). type DNSRecord struct { ID int64 `gorm:"primaryKey" json:"id"` ZoneID int64 `gorm:"column:zone_id" json:"zone_id"` Name string `gorm:"column:name" json:"name"` RecordType string `gorm:"column:record_type" json:"record_type"` Value string `gorm:"column:value" json:"value"` TTL int `gorm:"column:ttl" json:"ttl"` Active bool `gorm:"column:active" json:"active"` CreatedAt time.Time `gorm:"column:created_at" json:"created_at"` UpdatedAt time.Time `gorm:"column:updated_at" json:"updated_at"` } func (DNSRecord) TableName() string { return "dns_records" } // DNSSettings ist eine Single-Row-Tabelle mit globalen Resolver- // Optionen. Default kommt aus der Migration (alle Werte sinnvoll // für die typische LAN-Resolver-Rolle). type DNSSettings struct { ID int64 `gorm:"primaryKey" json:"id"` ListenAddresses string `gorm:"column:listen_addresses" json:"listen_addresses"` ListenPort int `gorm:"column:listen_port" json:"listen_port"` UpstreamForwards string `gorm:"column:upstream_forwards" json:"upstream_forwards"` AccessACL string `gorm:"column:access_acl" json:"access_acl"` DNSSEC bool `gorm:"column:dnssec" json:"dnssec"` QNameMinimisation bool `gorm:"column:qname_minimisation" json:"qname_minimisation"` CacheMinTTL int `gorm:"column:cache_min_ttl" json:"cache_min_ttl"` CacheMaxTTL int `gorm:"column:cache_max_ttl" json:"cache_max_ttl"` UpdatedAt time.Time `gorm:"column:updated_at" json:"updated_at"` } func (DNSSettings) TableName() string { return "dns_settings" }