jrittenh Tux's lil' helper
Joined: 10 Feb 2005 Posts: 92
|
Posted: Mon Nov 30, 2009 5:57 am Post subject: DNS entry for default gateway (laptop connection monitoring) |
|
|
I recently started using Link Monitor to track a few different points "out there" either on my local network or across the Internet. My main goal is to have a quick visual reference to tell if I'm: A. connected to a network and B. able to route to the outside world. I'm currently pinging my home router, Google, and the DNS entry for my default gateway when connected to the wired network at work (which is unroutable from outside the network, so I've configured a static DNS entry on my home router to point to itself).
What I'd like to do is have the gateway ping dynamically update its address to ping whatever the current default gateway with the best metric is in the routing table, no matter where I am. I'm thinking a script to update the hosts file dynamically might work, but was hoping the Gentoo community might have a better idea (or a workable script) as I don't really want to take the time to write a script to parse the hosts file, find a specific line, and replace the IP if something exists that can do this already. If I need to run something like dnsmasq I'm not opposed to that but I'd prefer to have something using nscd and the routing table and little else. If someone has a script to dynamically update a single line in the /etc/hosts file already I'd be happy with that, but if there's a way to just point nscd at the routing table I'd be even happier...I'm just not familiar enough with Linux networking tools to know if this is possible without the script facilitating things...nscd seems to be pretty basic, so I'm guessing it's just not that smart...I'm hoping someone can tell me otherwise, or have a different solution. |
|