nip.io is a dns service that responds with an ip address to a simple dns question, following a very simple nomenclature.
In the past there was the xip.io
service but it has been shut down for a while and it can no longer be used
This is very useful for deploying a named-based virtualhost server at your home or office.
Having for example a server that has the address 10.10.0.2
and we want to run an Apache on that server that responds with different content based on the hostname that reaches it.
http://foo.10.10.0.2.nip.io
respond with the address 10.10.0.2
http://bar.10.10.0.2.nip.io
respond with the address 10.10.0.2
Any string that you put in front of 10.10.0.2.nip.io will be ignored and only the IP address will be taken into account.
With this, it will not be necessary to add addresses in the /etc/hosts
file to make use of named-based virtualhost
dig foo.10.10.0.2.nip.io @1.1.1.1
; <<>> DiG 9.11.3-1ubuntu1.15-Ubuntu <<>> foo.10.10.0.2.nip.io @1.1.1.1
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 24877
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1232
;; QUESTION SECTION:
;foo.10.10.0.2.nip.io. IN A
;; ANSWER SECTION:
foo.10.10.0.2.nip.io. 432000 IN A 10.10.0.2
;; Query time: 67 msec
;; SERVER: 1.1.1.1#53(1.1.1.1)
;; WHEN: Sun Oct 03 19:26:53 CEST 2021
;; MSG SIZE rcvd: 65