Skip to content

Subdomains Locally

Joel Meador edited this page Jun 5, 2026 · 1 revision

I am running an application that uses subdomains, how do I work with this locally?

I don't want to buy a domain or fake one out.

SmartLogic has a domain that has two DNS records set up for this purpose. sldev.me has a wildcard record for subdomains and the domain itself, they both point to 127.0.0.1.

If you've used lvh.me in the past, this is similar but controlled by SmartLogic.

See below for examples on how to use it.

Naked Domain

$ dig sldev.me

; <<>> DiG 9.16.16 <<>> sldev.me
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 27222
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1232
;; QUESTION SECTION:
;sldev.me.                      IN      A

;; ANSWER SECTION:
sldev.me.               900     IN      A       127.0.0.1

;; Query time: 56 msec
;; SERVER: 1.1.1.1#53(1.1.1.1)
;; WHEN: Mon Jun 07 13:54:38 EDT 2021
;; MSG SIZE  rcvd: 53

With Subdomain

$ dig org.sldev.me

; <<>> DiG 9.16.16 <<>> org.sldev.me
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 46732
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1232
;; QUESTION SECTION:
;org.sldev.me.                  IN      A

;; ANSWER SECTION:
org.sldev.me.           900     IN      A       127.0.0.1

;; Query time: 26 msec
;; SERVER: 1.1.1.1#53(1.1.1.1)
;; WHEN: Mon Jun 07 13:54:50 EDT 2021
;; MSG SIZE  rcvd: 57

Home

TODO: can we recreate the tag system here roughly with sections about certain subjects?

Clone this wiki locally