If you are connecting to the remote computer via an internal IP address... in other words, you and the remote computer are both on the same LAN, then you should actually go into the router's administration panel, into the DHCP reservation table, and have that computer always be assigned the same IP address by it's MAC address. That way, regardless of how often it is disconnected, it will always be assigned the same internal IP address by the router.
If you are connecting to this remote computer via the internet, then I would follow these instructions at Ubuntu.com to set it up for proper handling of a Dynamic IP address. Yes, it would SEEM like you shouldn't need this, however I can tell you from experience that after you set up with a free DynamicDNS provider (like DYNDNS.com or No-ip.com) even though you are on the same LAN, you can still connect to your new domain, rather than an IP address. That means if you set up an account with DynDNS.com, and you created the domain there of jimiblob.mine.nu, after installing the DynDNS linux client and settings on the Ubuntu machine, you would simply have to connect to jimiblob.mine.nu instead of the internal IP address... and it would work regardless of any change in that internal IP address.
Of course, combining both solutions is ideal... reserving the Internal IP address in the DHCP reservation table, and using a Dynamic IP service.
I have a home server I like to access on the road. I use a dynamic DNS service like this. And regardless of whether I am on the LAN or out of the house, I still use the same account subdomain to remote in to that computer... and it works just fine.