code: func (h *Hosts) Reload(r io.Reader) error {
  	var period time.Duration
  	var hosts []Host
  
  	if r == nil || h.Stopped() {
  		return nil
  	}
  
  	scanner := bufio.NewScanner(r)
  	for scanner.Scan() {
  		line := scanner.Text()
  		ss := splitLine(line)
  		if len(ss) < 2 {
  			continue // invalid lines are ignored
  		}
  
  		switch ss[0] {
  		case "reload": // reload option
  			period, _ = time.ParseDuration(ss[1])
  		default:
  			ip := net.ParseIP(ss[0])
  			if ip == nil {
  				break // invalid IP addresses are ignored
  			}
  			host := Host{
  				IP:       ip,
  				Hostname: ss[1],
  			}
  			if len(ss) > 2 {
  				host.Aliases = ss[2:]
  			}
  			hosts = append(hosts, host)
  		}
  	}
  	if err := scanner.Err(); err != nil {
  		return err
  	}
  
  	h.mux.Lock()
  	h.period = period
  	h.hosts = hosts
  	h.mux.Unlock()
  
  	return nil
  }
docs: // Reload parses config from r, then live reloads the hosts.