Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Ok so i got this linux server running slackware 10.2.
So sometimes after i reboot it, it changes IP adress and i have to go there and check what IP adress it has changed to so i can update my dns server and stuffs..
But is there a way to check that IP adress without going there? Like some program on my server that sends some ping or so to my machine so i can check what the ip has changed to?
If your network interface is eth0, the following returns the IP address. You can run it as a cron job and do something based on whether the output changes. I've used the full path to each executable because on my system cron runs with a different environment:
If you're using a dynamic DNS provider like dyndns.com, I'd recommend looking at one of the tools already out there to do this sort of thing. There are a couple at http://www.dyndns.com/support/clients/unix.html - I use ddclient and haven't had any problems with it.
Im using http://www.mydomain.com/
And to tell the truth im not very good with linux machines..
So that code u typed there dident actually say me much.
So if u could be a bit more specific what it does id be very happy
In that case, you only need to read my very first sentence. That code returns your IP address
Just to make sure we're talking about the same thing. The DNS you're talking about updating - is it a DNS server that you run, or is it the mydomain.com DNS server?
If mydomain.com is running the DNS you wish to update, I'd suggest looking for available client scripts that handle this issue and running it periodically (check out "cron").
The line Gilead provided retrieves the information about eth0 and *processes* it to remvoe everything except the device's current IP address.
A quick read of any introduction to linux shell commands should familiarize you with how to run commands in the shell, write scripts and all sorts of cool things you can do.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.