{"record":{"id":"c50c28f09b05a8a3","repo":"kgretzky/evilginx2","slug":"edit-lure-hostname-must-end-with-the-base-domain","errorCode":null,"errorMessage":"edit: lure hostname must end with the base domain '%s'","messagePattern":"edit: lure hostname must end with the base domain '(.+?)'","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/terminal.go","lineNumber":922,"sourceCode":"\t\t\tif pn == 4 {\n\t\t\t\tl_id, err := strconv.Atoi(strings.TrimSpace(args[1]))\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn fmt.Errorf(\"edit: %v\", err)\n\t\t\t\t}\n\t\t\t\tl, err := t.cfg.GetLure(l_id)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn fmt.Errorf(\"edit: %v\", err)\n\t\t\t\t}\n\t\t\t\tval := args[3]\n\t\t\t\tdo_update := false\n\n\t\t\t\tswitch args[2] {\n\t\t\t\tcase \"hostname\":\n\t\t\t\t\tif val != \"\" {\n\t\t\t\t\t\tval = strings.ToLower(val)\n\n\t\t\t\t\t\tif val != t.cfg.general.Domain && !strings.HasSuffix(val, \".\"+t.cfg.general.Domain) {\n\t\t\t\t\t\t\treturn fmt.Errorf(\"edit: lure hostname must end with the base domain '%s'\", t.cfg.general.Domain)\n\t\t\t\t\t\t}\n\t\t\t\t\t\thost_re := regexp.MustCompile(`^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\\-]*[a-zA-Z0-9])\\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\\-]*[A-Za-z0-9])$`)\n\t\t\t\t\t\tif !host_re.MatchString(val) {\n\t\t\t\t\t\t\treturn fmt.Errorf(\"edit: invalid hostname\")\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tl.Hostname = val\n\t\t\t\t\t\tt.cfg.refreshActiveHostnames()\n\t\t\t\t\t\tt.manageCertificates(true)\n\t\t\t\t\t} else {\n\t\t\t\t\t\tl.Hostname = \"\"\n\t\t\t\t\t}\n\t\t\t\t\tdo_update = true\n\t\t\t\t\tlog.Info(\"hostname = '%s'\", l.Hostname)\n\t\t\t\tcase \"path\":\n\t\t\t\t\tif val != \"\" {\n\t\t\t\t\t\tu, err := url.Parse(val)\n\t\t\t\t\t\tif err != nil {","sourceCodeStart":904,"sourceCodeEnd":940,"githubUrl":"https://github.com/kgretzky/evilginx2/blob/4c0988a1d9db4d172a185e979a38bfd0efdb5830/core/terminal.go#L904-L940","documentation":"Validation error for `lures edit <id> hostname <val>`: the new hostname must equal the configured base domain (t.cfg.general.Domain) or be a subdomain ending with '.'+baseDomain. This keeps lure hostnames inside domains covered by the phishlet/proxy configuration so TLS certificates can be issued.","triggerScenarios":"`lures edit 2 hostname totally-unrelated.com` where general.Domain is e.g. example.com and the value is neither example.com nor *.example.com.","commonSituations":"Typing a domain without its subdomain suffix, forgetting to add the subdomain to phishlet hostnames first, or having a stale/misconfigured base domain in config.yaml.","solutions":["Use a hostname that is the base domain or a subdomain of it, e.g. `lures edit 2 hostname login.example.com`","If a different domain is intended, update `domain` in config.yaml (and the phishlet) first","Check the current base domain with `config domain` before editing"],"exampleFix":"// before\nlures edit 2 hostname phishing.other.net\n// after (base domain example.com)\nlures edit 2 hostname login.phishing.example.com","handlingStrategy":"validation","validationCode":"val := strings.ToLower(val)\nif val != domain && !strings.HasSuffix(val, \".\"+domain) {\n\treturn fmt.Errorf(\"hostname must end with base domain %s\", domain)\n}","typeGuard":"func isUnderBaseDomain(host, domain string) bool {\n\thost = strings.ToLower(host)\n\treturn host == domain || strings.HasSuffix(host, \".\"+domain)\n}","tryCatchPattern":null,"preventionTips":["Check `config domain` to know the current base domain before editing hostnames","Only use hostnames already allowed by the phishlet's hostnames","Keep hostnames lowercase — the check lowercases before comparing"],"tags":["go","cli","validation","dns"],"backgroundTag":"hostname-domain-mismatch","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"}