0

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.

Sebastian
  • 101
  • 2
    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 – M_dk Jan 14 '22 at 07:23
  • https://superuser.com/questions/274562/teach-google-chrome-to-understand-custom-tld – AlexD Jan 14 '22 at 07:42

1 Answers1

0

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

Sebastian
  • 101