Score:0

How can I implement single letter domains for LAN internet browsing using dnsmasq?

us flag

In our LAN I have several services running in multiple hosts, and clients using DHCP with dnsmasq.

My goal is that any user can type a single letter (e.g. c) in the browser search bar and get in return the HTTP response of a local HTTP server at 192.168.2.120.

What I've done so far:

dnsmasq.conf file in the DHCP LAN server:

# (c.com is an example)
# The idea of the below is that clients will append c.com to DNS lookups when they look up for "c"
dhcp-option=option:domain-name,c.com
dhcp-option=option:domain-search,c.com

/etc/hosts in the DHCP server:

192.168.2.120 c.c.com c.com

What's working:

  • I've confirmed with tcpdump that the clients receive the options in the DHCP response.
  • curl c, curl c.c.com, and curl c.com all work fine. They all point to 192.168.2.120 and get the expected HTTP traffic.

However, typing "c" in the browser bar triggers a Google search (tested in Firefox/Edge/Chrome). It works only if I type "http://c".

What else I'm missing so that internet browsers can work like curl, and don't trigger a search? I know it's possible because I've seen it implemented in some workplaces. I'm missing some part of the puzzle.

cn flag
This is because the browser assumes that you want to search for a keyword when you put in a string that is not a valid public domain so you have to dig into the settings of the browser you are using
jp flag
https://superuser.com/questions/274562/teach-google-chrome-to-understand-custom-tld
Score:0
us flag

@AlexD comment pointed me to the right solution. Using "c/" (i.e. appending a slash) triggers the expected behaviour.

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.