Skip to content

Instantly share code, notes, and snippets.

@hakluke
Last active November 27, 2023 21:08
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save hakluke/d4ba893149a65c737357b377de92c94e to your computer and use it in GitHub Desktop.
Generate all 3 character domains of all TLDs in ./tlds.txt
package main
import (
"bufio"
"fmt"
"os"
)
func main() {
chars := []string{"1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "q", "w", "e", "r", "t", "y", "u", "i", "o", "p", "a", "s", "d", "f", "g", "h", "j", "k", "l", "z", "x", "c", "v", "b", "n", "m", "-"}
file, _ := os.Open("./tlds.txt")
defer file.Close()
scanner := bufio.NewScanner(file)
for scanner.Scan() {
for _, one := range chars {
for _, two := range chars {
for _, three := range chars {
if one != "-" && three != "-" {
fmt.Printf("%s%s%s.%s\n", one, two, three, scanner.Text())
}
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment