News: This forum is now permanently frozen.
Pages: [1]
Topic: Hosts file  (Read 1997 times)
« on: January 24, 2012, 18:42:19 »
JoeSpam8 *
Posts: 3

I would like to see a possibility to add single-name hosts instead of a full domain name. In this way I can resolve "router" instead of "router.local". I guess this would be pretty easy to implement even?
« Reply #1 on: January 24, 2012, 19:06:13 »
Fred Grayson *****
Posts: 994

Workaround of sorts, for what it's worth.

In Services: DNS forwarder, add a host, domain, and IP, save the changes:

router local 192.168.1.2

In Diagnostics: Backup/restore, download the configuration to file.

Edit the file to remove the domain entered and save the file.

<hosts>
         <host>router</host>
         <domain></domain>
         <ip>192.168.1.2</ip>
         <descr/>
</hosts>

In Diagnostics: Backup/restore Restore configuration, Browse to the edited configuration file and restore. m0n0wall will reboot.

You can now use router. to refer to the entered IP. Note the dot at the end of the host.


Note, it is possible to make additions to m0n0wall's /etc/hosts file by executing things like this from the /exec.php page:

echo "192.168.1.2 router" >>/etc/hosts

cat /etc/hosts      to confirm the entry.

But this will only work from within mon0wall itself, not connected hosts.
   
« Last Edit: January 24, 2012, 19:21:06 by fredg »

--
Google is your friend and Bob's your uncle.
« Reply #2 on: March 10, 2012, 15:05:54 »
primo44 *
Posts: 3

I would like to see a possibility to add single-name hosts instead of a full domain name. In this way I can resolve "router" instead of "router.local". I guess this would be pretty easy to implement even?

Resolving unqualified DNS names is a function of the client, not the server.  In the m0n0wall "general setup" page, what do you have for "domain"?  If that's set to "local", all the clients should be getting it as their default domain and/or DNS search suffix, so when you ask any of them to resolve "router" they should already be trying "router.local".
 
Pages: [1]
 
 
Powered by SMF 1.1.20 | SMF © 2013, Simple Machines