{"record":{"id":"94eb2109ce8e40b3","repo":"kgretzky/evilginx2","slug":"no-hostname-set-for-phishlet-s","errorCode":null,"errorMessage":"no hostname set for phishlet '%s'","messagePattern":"no hostname set for phishlet '(.+?)'","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/terminal.go","lineNumber":665,"sourceCode":"\t\t\terr := t.cfg.SetSiteHidden(args[1], true)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\treturn nil\n\t\tcase \"unhide\":\n\t\t\terr := t.cfg.SetSiteHidden(args[1], false)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\treturn nil\n\t\tcase \"get-hosts\":\n\t\t\tpl, err := t.cfg.GetPhishlet(args[1])\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tbhost, ok := t.cfg.GetSiteDomain(pl.Name)\n\t\t\tif !ok || len(bhost) == 0 {\n\t\t\t\treturn fmt.Errorf(\"no hostname set for phishlet '%s'\", pl.Name)\n\t\t\t}\n\t\t\tout := \"\"\n\t\t\thosts := pl.GetPhishHosts(false)\n\t\t\tfor n, h := range hosts {\n\t\t\t\tif n > 0 {\n\t\t\t\t\tout += \"\\n\"\n\t\t\t\t}\n\t\t\t\tout += t.cfg.GetServerExternalIP() + \" \" + h\n\t\t\t}\n\t\t\tt.output(\"%s\\n\", out)\n\t\t\treturn nil\n\t\t}\n\t} else if pn == 3 {\n\t\tswitch args[0] {\n\t\tcase \"hostname\":\n\t\t\t_, err := t.cfg.GetPhishlet(args[1])\n\t\t\tif err != nil {\n\t\t\t\treturn err","sourceCodeStart":647,"sourceCodeEnd":683,"githubUrl":"https://github.com/kgretzky/evilginx2/blob/4c0988a1d9db4d172a185e979a38bfd0efdb5830/core/terminal.go#L647-L683","documentation":"When showing phishlet URLs (`phishlets get-url <name>`), the base hostname must have been set beforehand via `phishlets hostname <name> <host>`. If GetSiteDomain returns no domain or an empty string for the phishlet, this error is returned since a URL cannot be constructed.","triggerScenarios":"Calling `phishlets get-url <name>` (or a lure get-url referencing the phishlet) when no hostname was ever configured for that phishlet, or the hostname was cleared/reset.","commonSituations":"Fresh setup where `phishlets hostname` was skipped; typo'd phishlet name that resolved to another phishlet without a hostname; config reloaded after certificate/hostname loss; DNS/proxy config wiped the site domain.","solutions":["Set a hostname first: `phishlets hostname <phishlet> login.yourdomain.com`","Verify DNS records for the chosen hostname point to your server, then re-run get-url","Confirm the phishlet name is correct with `phishlets` (status listing)","Persist the hostname in config so reloads don't lose it"],"exampleFix":"// before\nphishlets get-url o365:corp\n// after\nphishlets hostname o365:corp login.corp.example.com\nphishlets get-url o365:corp","handlingStrategy":"validation","validationCode":"bhost, ok := t.cfg.GetSiteDomain(plName)\nif !ok || len(bhost) == 0 {\n    return fmt.Errorf(\"set a hostname first: phishlets hostname %s <host>\", plName)\n}","typeGuard":"func hasHostname(cfg *Config, plName string) bool {\n    h, ok := cfg.GetSiteDomain(plName)\n    return ok && len(h) > 0\n}","tryCatchPattern":"if err := getUrl(plName); err != nil {\n    if strings.Contains(err.Error(), \"no hostname set\") {\n        cfg.SetSiteHostname(plName, defaultHost)\n        return getUrl(plName)\n    }\n    return err\n}","preventionTips":["Always run `phishlets hostname <name> <host>` before get-url","Persist hostnames in config to survive reloads","Verify DNS before choosing the hostname"],"tags":["phishlet","configuration","hostname"],"backgroundTag":"missing-hostname-config","analyzedSha":"4c0988a1d9db4d172a185e979a38bfd0efdb5830","analyzedAt":"2026-09-05T19:23:07.238Z","contentChangedAt":"2026-09-05T19:23:07.238Z","schemaVersion":2},"datasetVersion":"2026-09-12T22:17:10.623Z"}