code: func (network *network) ipToHostname(ip net.IP) (name string) {
  	if ipv4 := ip.To4(); ipv4 != nil {
  		// replace . to -
  		name = ipv4.String()
  	} else {
  		// assume v6
  		// ensure zeros are present in string
  		buf := make([]byte, 0, len(ip)*4)
  		for i := 0; i < len(ip); i++ {
  			v := ip[i]
  			buf = append(buf, hexDigit[v>>4])
  			buf = append(buf, hexDigit[v&0xF])
  		}
  		name = string(buf)
  	}
  	// inject the converted ip into the fqdn template
  	return strings.Replace(network.Template, templateNameIP, name, 1)
  }
docs: // ipToHostname converts an IP to an DNS compatible hostname and injects it into the template.domain.