Hello all! I have a couple of ideas for something but I have NO IDEA how to even carry them out.
1)Ok my LAN is using a router that uses dhcp to assign the local ip addresses. For my newly created "server" I would like to make some sort of script that assigns the current ip with a FQDN izan.athome. The only way I can think of to do somehting like this is to make a script that edits the /etc/hosts file. I was thinking that a command like this: ifconfig eth0 |grep "inet addr"
will get me the address plus misc stuff. I just can't think of how to use regex to strip the address out, but that is how I figure you could get the ip address assigned to the laptop then append a line to the /etc/hosts file to something like:
192.168.0.3 izan.athome izan
2)Can I just add a mask to the hosts file, something like:
192.168.0.0/24 izan.athome izan
192.168.0.0-32 izan.athome izan
Just curious, cuz I can't get to my laptop from my pc using the hostname in my browser(I'm running Apache w/PHP-MySQL support and SSH probably gonna have to use FTP at some point later on too... to get the files there) but I can finally get to it using the ip address.