Score:0

DNS redirect to a static IP?

ng flag

I want to implement a URL shortener using a DNS modification. Is this possible? It would do things like convert a domain name to a static IP:

https://fubar/keyword -> https://192.168.0.200/keyword

Ideally it would be a single word ''domain'', like fubar, not fubar.TLD.

vn flag
DNS doesn't get path information, and you're gonna need a TLD if anyone outside your local network needs to use it.
Patrick Mevzek avatar
cn flag
Don't use HTTPS URLs with IP addresses instead of hostnames. You will have all sorts of problems even if you can have technically certificates based on IP addresses but it is rare, and you will mostly get errors.
Patrick Mevzek avatar
cn flag
If this is for internal needs, look/control at clients DNS configuration using either the search list at the OS level, or some kind of proxy at the HTTP level, through a Javascript file where you can control how the resolution happens.
ng flag
More than one person needs to use this, and with devices that may not accept a proxy.
Score:1
fr flag

If you are doing this for your own computer, or your LAN users, you can modify /etc/hosts to achieve this. For Windows, it will be somewhere in {WindowsOS}/etc/hosts

ng flag
No, that won't work. Some browsers bypass /etc/hosts.
Ben L avatar
fr flag
@nodnarbog never heard of that situation. What kind of browser are you using?
vn flag
@BenL Firefox and Chrome both recently added DNS over HTTPS (DOH).
Ben L avatar
fr flag
for https, it is not recommended to temper the traffic. https communication usually require the origin domain name to verify the authenticity. My suggestion is only for http communication.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.