Search code examples
.htaccessdnsipsubdomaina-records

How to point subdomain to an ip and retain domain name


Given:

  • a domain w/ gofather: gloriousdomain.com
    • w/ nameservers pointing to server w/ hostcrocodile
  • a subdomain: sub.gloriousdomain.com
  • a server w/ digitalpond and ip: 123.456.78.9
  • an A-Recordin hostcrocodile pointing sub.gloriousdomain.com -> 123.456.789

How do I make it so that when I enter sub.gloriousdomain.com in my browser it doesn't just reroute me and change my url to 123.456.78.9


cases where it's worked before

  • wordpress :
    • when you first set it up, it does the whole route to ip thing
    • then you finish the setup w/ it asking the subdomain and magically it's fixed
  • redmine
    • routes to ip until you type in the subdomain

Interesting facts

  • When I ping 123.456.78.9 it pings back 123.456.78.9
  • I thought passenger on top of nginx was doing some work helping the resoloution for redmine and that's why it worked, but to test it I stopped the service and pinged my redmine box

Solution

  • It turns out it was my ISP.

    I reset my router thinking perhaps it was caching the page, turns out it was the ISP, they were serving me a cached version.