Results 1 to 9 of 9
Hello,
I try to forward all the network traffic on specific port from my VPS to home PC.
The problem is that I have dynamic IP at home so I've ...
- 02-27-2011 #1Just Joined!
- Join Date
- Feb 2011
- Posts
- 14
DNS cache, Dynamic IP
Hello,
I try to forward all the network traffic on specific port from my VPS to home PC.
The problem is that I have dynamic IP at home so I've installed Dynamic Update Client (DUC) from no-ip.com.
I also use 'redir' software on Centos VPS to redirect the traffic and everything works fine till my ISP change the IP of my home PC.
Does Centos cache DNS queries by default (nscd is not running)?
Is there a some way/software that will periodically check if the IP of particular domain has changed and update accordingly.
Do you know some better way to achieve this?
I also found something like this:
hxxp://ipupdate.sourceforge.net/index.html
- 02-27-2011 #2
Welcome to the forums!
When you update your DNS with a service such as no-ip (or any and all other such services) it takes a while for this updated config to spread around the world.
All the servers that make up the internets DNS sync with each other. And this makes that it can take up to 24 or even as much as 72 hours before all servers know your 'new' IP address. In reality however my experience is that it takes some three/four hours.
Could it be that this is causing the problem you're having?Can't tell an OS by it's GUI
- 02-27-2011 #3Just Joined!
- Join Date
- Feb 2011
- Posts
- 14
Thank you for reply.
- it's actually works right after reboot so it looks like DNS propagates quite fast
I think 'redir' just run on the old IP - on which the connection was established initially so I need some way to refresh it.
Do you know some better way to forward network traffic from one IP to FQDN (no static IP) on specific port
Maybe local DNS server will help?
- 02-27-2011 #4Sorry, I'm not sure what you mean by 'it works' or why you'd need a reboot? And what you reboot so that it works?
Originally Posted by HTF Can't tell an OS by it's GUI
- 02-27-2011 #5Just Joined!
- Join Date
- Feb 2011
- Posts
- 14
Sorry for misleading.
As I mentioned before I use 'redir' to forward traffic, so I created simple rule:
- and added to /etc/rc.local to start at bootredir --lport=10000 --laddr=xxx.xxx.xxx.xxx --cport=10000 --caddr=domain.com &
- so when I reboot my VPS after the IP of my home PC has been changed by ISP this redirection works again but I think it's not a problem with DNS itself. The reboot just probably reset the connection and forced 'redir' to establish another one with new IP.
- 02-27-2011 #6
Ok, but wouldn't that mean that killing and restarting 'redir' would also work?
I mean, I can imagine redir, upon launch, check the DNS once and keep whatever value for IP address is returned. It probably wont check periodically to see if the value has changed.
If that is the case, what you need is some process that checks if the IP address tied to your domain name has changed while redir was running, and restart redir so that it picks up the new IP address. I suppose...
EDIT: Running a local DNS would, IMHO, only make matters worst as that will probably make a cache of it's own and prevent quick updating of the address translation. It could be configured to not do that, but that would defeat the purpose of running a local DNS service.Can't tell an OS by it's GUI
- 02-27-2011 #7Just Joined!
- Join Date
- Feb 2011
- Posts
- 14
Yes, you are right.Ok, but wouldn't that mean that killing and restarting 'redir' would also work?
Exactly but how to achieve this if I'm not to good with scripting.I mean, I can imagine redir, upon launch, check the DNS once and keep whatever value for IP address is returned. It probably wont check periodically to see if the value has changed.
If that is the case, what you need is some process that checks if the IP address tied to your domain name has changed while redir was running, and restart redir so that it picks up the new IP address. I suppose...
- 02-27-2011 #8
Ok, well advanced bash scripting guide is an excellent resource on scripting.
What you're looking for is something along these lines (untested!)
First:
host $yourdomain|grep address|head -1|awk '{print $4}'>/tmp/mydomain.ipaddress
Then make a cron job that runs every half hour (or so...)
Code:#!/bin/bash echo "This is untested, ugly and probably wont really work; for example purposes only!" exit YOURDOMAIN=yourdomain.name TMPFILE="/tmp/mydomain.ipaddress" LOGFILE="/tmp/mydomain.log" OLD_ADDRESS=` cat $TMPFILE` NEW_ADDRESS=` host $YOURDOMAIN |\ grep "address" |\ head -1 |\ awk '{print $4}' ` if [ "$OLD_ADDRESS" != "$NEWADDRESS" ] then echo "$NEW_ADDRESS" > $TMPFILE killall redir # The ampersand is where the magic is. It pushes # redir into a subshell, allowing this script to # continue and exit. redir --with-options --with-extras & echo "new address discovered at `date`">$LOGFILE else echo "debug info: no changes at `date`">>$LOGFILE fiCan't tell an OS by it's GUI
- 02-27-2011 #9Just Joined!
- Join Date
- Feb 2011
- Posts
- 14
OK thank you.
Do you think I can set this up with some VPN configuration or SSH tunnelling?
I'm not quite sure how to set VPN as it's VPS based on openVZ. It has TUN/TAP enabled and I tried to install vtun but I can't get this to work at all.


Reply With Quote
