Skip to content

Commit cef7489

Browse files
committed
feat(ingress): support wildcard custom domains in TXT record setup
When DOMAIN is a wildcard (e.g. *.myapp.com), set the TXT record to _dstack-app-address-wildcard.myapp.com instead of _dstack-app-address.*.myapp.com, matching the gateway's new wildcard TXT resolution fallback.
1 parent a690aa3 commit cef7489

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

custom-domain/dstack-ingress/scripts/entrypoint.sh

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,8 +231,16 @@ set_txt_record() {
231231
fi
232232
APP_ID=${APP_ID:-"$DSTACK_APP_ID"}
233233

234+
local txt_domain
235+
if [[ "$domain" == \*.* ]]; then
236+
# Wildcard domain: *.myapp.com → _dstack-app-address-wildcard.myapp.com
237+
txt_domain="${TXT_PREFIX}-wildcard.${domain#\*.}"
238+
else
239+
txt_domain="${TXT_PREFIX}.${domain}"
240+
fi
241+
234242
dnsman.py set_txt \
235-
--domain "${TXT_PREFIX}.${domain}" \
243+
--domain "$txt_domain" \
236244
--content "$APP_ID:$PORT"
237245

238246
if [ $? -ne 0 ]; then

0 commit comments

Comments
 (0)