Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I found its internal working quite interesting:

    $ dig 127.0.0.1.xip.io
    ;; ANSWER SECTION:
    127.0.0.1.xip.io.     403     IN     CNAME     9zlhb.xip.io.
    9zlhb.xip.io.         405     IN     A         127.0.0.1
Returning CNAME pointing to some record? Apparently, 9zlhb is a base 36 of integer of 1.0.0.127.

    ip:      1.0.0.127
    dec:     16777343
    base 36: 9zlhb
I guess they decided to reverse the IP address to make generated CNAME scale better (in number of characters):

                base 36   reverse base 36
    1.0.0.0     9ZLDS     1
    10.0.0.1    2RVXTT    9ZLE2
    127.0.0.1   Z8KFLT    9ZLHB


The most recent commit[1] causes the server to return an A record instead of a CNAME.

[1] https://github.com/sstephenson/xipd/commit/ea40f65300ccc3d32...


There is http://nip.io as well, which does resolutions quite straight forward:

   $ dig 127.0.0.1.nip.io
   ;; ANSWER SECTION:
   127.0.0.1.nip.io.	432000	IN	A	127.0.0.1


Hmm, this doesn't seem to be working for me in the same way that xip.io does.

One of my favorite features of Pow (also 37Signals, mentioned on xip.io) is the ability to forward .dev domains to certain ports. For instance:

`echo 3000 >> ~/.pow/myapplication` gives you `myapplication.dev` as an alias for `localhost:3000`.

xip.io seems to be able to figure that out -- myapplication.10.0.0.1.xip.io will work, whereas myapplication.10.0.0.1.nip.io does not (just shows the Pow page you would see for going to `localhost`).

Am I missing something here to get it to work with nip.io? I'm all for simpler tools, but since the port functionality is 100% of what I use Pow for, xip.io seems to be the way to go for now.


Pow has a special support for .xip.io domain[1]. If you add `export POW_EXT_DOMAINS=10.0.0.1.nip.io pow` to `~/.powconfig` it should work[2]. I haven't tried this myself though.

[1]: https://github.com/basecamp/pow/blob/master/lib/configuratio...

[2]: http://pow.cx/docs/configuration.html


The code is on github https://github.com/sstephenson/xipd/blob/master/src/index.co.... I wonder if it was just an oversight in parsing the string, rather than deliberate.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: