Track adds a resolved domain to the list.
(resolved string, hostname string)
| 56 | |
| 57 | // Track adds a resolved domain to the list. |
| 58 | func Track(resolved string, hostname string) { |
| 59 | lock.Lock() |
| 60 | defer lock.Unlock() |
| 61 | |
| 62 | if len(resolved) > 3 && resolved[0:4] == "127." { |
| 63 | return |
| 64 | } |
| 65 | if resolved == "::1" || resolved == hostname { |
| 66 | return |
| 67 | } |
| 68 | responses[resolved] = hostname |
| 69 | |
| 70 | log.Debug("New DNS record: %s -> %s", resolved, hostname) |
| 71 | } |
| 72 | |
| 73 | // Host returns if a resolved domain is in the list. |
| 74 | func Host(resolved string) (host string, found bool) { |
no test coverage detected