Browse Source

set SOA contact

Leif Johansson 13 years ago
parent
commit
175a814b7f
2 changed files with 6 additions and 2 deletions
  1. 5 2
      config.go
  2. 1 0
      types.go

+ 5 - 2
config.go

@@ -97,6 +97,7 @@ func readZoneFile(zoneName, fileName string) (*Zone, error) {
 	Zone.LenLabels = dns.LenLabels(Zone.Origin)
 	Zone.LenLabels = dns.LenLabels(Zone.Origin)
 	Zone.Options.Ttl = 120
 	Zone.Options.Ttl = 120
 	Zone.Options.MaxHosts = 2
 	Zone.Options.MaxHosts = 2
+	Zone.Options.Contact = "support.bitnames.com"
 
 
 	if err == nil {
 	if err == nil {
 		var objmap map[string]interface{}
 		var objmap map[string]interface{}
@@ -113,12 +114,14 @@ func readZoneFile(zoneName, fileName string) (*Zone, error) {
 			//log.Printf("k: %s v: %#v, T: %T\n", k, v, v)
 			//log.Printf("k: %s v: %#v, T: %T\n", k, v, v)
 
 
 			switch k {
 			switch k {
-			case "ttl", "serial", "max_hosts":
+			case "ttl", "serial", "max_hosts", "contact":
 				switch option := k; option {
 				switch option := k; option {
 				case "ttl":
 				case "ttl":
 					Zone.Options.Ttl = valueToInt(v)
 					Zone.Options.Ttl = valueToInt(v)
 				case "serial":
 				case "serial":
 					Zone.Options.Serial = valueToInt(v)
 					Zone.Options.Serial = valueToInt(v)
+				case "contact":
+					Zone.Options.Contact = v.(string)
 				case "max_hosts":
 				case "max_hosts":
 					Zone.Options.MaxHosts = valueToInt(v)
 					Zone.Options.MaxHosts = valueToInt(v)
 				}
 				}
@@ -342,7 +345,7 @@ func setupSOA(Zone *Zone) {
 	}
 	}
 
 
 	s := Zone.Origin + ". 3600 IN SOA " +
 	s := Zone.Origin + ". 3600 IN SOA " +
-		primaryNs + " support.bitnames.com. " +
+		primaryNs + " " + Zone.Options.Contact + " " +
 		strconv.Itoa(Zone.Options.Serial) +
 		strconv.Itoa(Zone.Options.Serial) +
 		" 5400 5400 2419200 " +
 		" 5400 5400 2419200 " +
 		strconv.Itoa(Zone.Options.Ttl)
 		strconv.Itoa(Zone.Options.Ttl)

+ 1 - 0
types.go

@@ -9,6 +9,7 @@ type Options struct {
 	Serial   int
 	Serial   int
 	Ttl      int
 	Ttl      int
 	MaxHosts int
 	MaxHosts int
+	Contact  string
 }
 }
 
 
 type Record struct {
 type Record struct {