Lurker News

Comments (102) 11 threads

Show all comments

Showing thread 5 of 11

grizzles3 replies#
Any chance for split horizon dns? The ability to perma-name all my home computers is something I've always wanted in a home router.
secure2 replies#
https://godoc.org/github.com/rtr7/router7/cmd/dnsd already resolves computer names from DHCP leases. Is that what you mean? If no, can you elaborate on what the use-case is?

Edit: forgot to mention, you can use static leases, too, permanently assigning an IP/hostname to a MAC address: just remove the expiration field in /perm/dhcp4d/leases.json :)

grizzles#
Oh cool re: dnsd
chrissnell1 reply#
Here's a use case that I am currently doing at home:

I have a live weather station [1] that pulls data from a Go-based service that I wrote and run on a server on my home network. When I'm outside of the house, mhkweather.com resolves to a Digital Ocean IP, where I run a proxy to forward requests back to home IP. However, when I'm at home, mhkweather.com resolves to a local 10.x.x.x IP and goes straight the the local service, no proxy. It faster this way. I want to be able to set DNS overrides for local things. I can do this with unbound but it would be nice if dnsd could do this for me.
[1] https://mhkweather.com

secure#
Thanks for elaborating.

For the time being, you’d need to modify dnsd to install your custom handler. It should be as simple as adding another server.mux.HandleFunc call in internal/dns/dns.go.
If this turns out to be a feature which many people would like, I’ll think about how to best structure the code to make this easier.

zamadatix1 reply#
Why do you need split horizon DNS for that?
grizzles3 replies#
So if I ssh into another computer by it's name everything works without me having to maintain a static device table somewhere w/scripts to deal with inevitable versioning issues.
chatmasta6 replies#
You don’t need split horizon dns as long as the router is running a resolver. Just configure the resolver to use some TLD (eg .local) as a local network so that it looks up any names ending in eg .local in its local /etc/hosts or equivalent.

Continue this thread — 6 replies

zamadatix#
Like the other person said that's just a normal DNS lookup, not split horizon. Use one of the private TLDs like .test or .local.
jethro_tell#
I posted how to do split horizon above. I get it. You don't want to change your ssh config and doing things on lan instead of going through the router interfaces is ideal.
Mister_Snuggles2 replies#
This seems to be a standard feature in many routers now. The computer name sent with the DHCP request will eventually land in the resolver's hosts table and it will respond to DNS requests as expected. It's client-controlled, which is kind of not great, but for home users it works as intended.

What I'd like to see is a home router that lets me put arbitrary rules in. Currently I use dnsmasq as a resolver and it basically does what I need, but I'd rather have it running on the router instead of needing another computer.
My current rule set is roughly:
* Resolve from local hosts file - this is where I put my statically assigned home servers/devices.
* If the domain request matches .domain.tld, forward it to a.b.c.d for resolution - this is a dnsmasq running on a remote box and covers off VMs that I run there. There is an IPSec tunnel (running on a small VM) and static routes on my router that handle getting to that box.
Finally, pass the request onto my router which will pass it onto my ISP or use its local DHCP-driven hosts table to resolve it.
I'd love it if an off-the-shelf router could do this. Currently I'm using a UniFi Security Gateway and it seems like this feature set would be a good fit. The router is professional-enough that advanced features like this make sense.

secure2 replies#
Have a look at router7’s dnsd, it’s not that complicated: https://github.com/rtr7/router7/blob/master/cmd/dnsd/dnsd.go You could easily fork it and extend it to implement your custom rules.

I’ve done Go cross-compilation for running on Ubiquiti gear before, and it worked. So, if you’re willing to spend the effort, you could do it :).

jethro_tell#
I have this set up in my house. I have a tld and internally I want the IP to resolve to the land IP and externally, to the ISP ip. I also have local caching for things like imap, but slow uploaded so I don't host my full email and web mail stack there.

I run 2 dns servers usually on the same box on different bind addresses. You'd run a caching resolver on the gw ip and forward requests for my.tld to the second resolver which is configured to be authoritative for my.tld. the hosts can then be configured either through DHCP or statically.
This is a pretty common technique to make enterprises Intranets.
Added benefit is that when you did a file transfer between Lan hosts with the globally accessable DNS, the transfer stays on the LAN. Also ssh host works in you ssh config regardless of location.

voltagex_1 reply#
Which Ubiquiti gear? I wasn't expecting one component to be on MIPS, one component to be on ARM7 without hardfloat and one component to be ARM7-A with vfp4.

I guess Go's cross compilation makes it easier.
PS: Without hardware offload, the 8 port POE switch only manages 12 megabits / second.

Continue this thread — 1 reply

voltagex_#
I'm running a similar setup (although without IPsec). My compromise was to have name.int.my.domain resolve internally and name.my.domain resolve externally (easier with ipv6).

dnsmasq should be able to do what you want to do and it can be enabled on the USG - at least from the controller.