You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to use Valet .test domains form my dev machine for all devices connected inside local network (my office devices).
So i figured out that what i could do is:
On my router set my static ip local machine with dnsmasq as one of DNS servers. This would mean the .test domanis should work as long as my dev machine is running. This could also work as nice DNS cache for the local network.
The main problem is that dnsmasq will respond with 127.0.0.1/localhost to any .test no matter if its coming from my local machine or if its on the network.
I would somehow need dnsmasq to respond with .test/127.0.0.1 if it was comming from my local machine and .test/192.168.0.123 if it was comming from outside of it. Not sure if thats even possible. I think it might be maybe by using option
--localise-queries
Return answers to DNS queries from /etc/hosts and --interface-name and --dynamic-host which depend on the interface over which the query was received. If a name has more than one address associated with it, and at least one of those addresses is on the same subnet as the interface to which the query was sent, then return only the address(es) on that subnet. This allows for a server to have multiple addresses in /etc/hosts corresponding to each of its interfaces, and hosts will get the correct address based on which network they are attached to. Currently this facility is limited to IPv4.
But i honestly have now idea how to do this. The only somewhat related thing i've found is [https://stackoverflow.com/questions/9326438/dnsmasq-serve-different-ip-addresses-based-on-interface-used/23951798#23951798](this stackoverflow).
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I would like to use Valet .test domains form my dev machine for all devices connected inside local network (my office devices).
So i figured out that what i could do is:
On my router set my static ip local machine with dnsmasq as one of DNS servers. This would mean the .test domanis should work as long as my dev machine is running. This could also work as nice DNS cache for the local network.
The main problem is that dnsmasq will respond with 127.0.0.1/localhost to any .test no matter if its coming from my local machine or if its on the network.
I would somehow need dnsmasq to respond with .test/127.0.0.1 if it was comming from my local machine and .test/192.168.0.123 if it was comming from outside of it. Not sure if thats even possible. I think it might be maybe by using option
But i honestly have now idea how to do this. The only somewhat related thing i've found is [https://stackoverflow.com/questions/9326438/dnsmasq-serve-different-ip-addresses-based-on-interface-used/23951798#23951798](this stackoverflow).
So in my naivety i've tried
But this is probably just doing something i don't want at all :D

Anyway i know i can share using ngrok over internet but this would be pretty cool feature for small offices etc.
If anybody knows a more about dnsmasq and networking it would be awesome 👍 thanks!
Beta Was this translation helpful? Give feedback.
All reactions