If you are using static private addresses, put the entry in /etc/hosts and in the hosts or lmhosts file (for a windows machine).
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
or
2)Can I just add a mask to the hosts file, something like:
192.168.0.0/24 izan.athome izan
or
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.
If you are using static private addresses, put the entry in /etc/hosts and in the hosts or lmhosts file (for a windows machine).
Yea,
why don't you just set your router to use static addresses? then you would add a name to hosts/lmhosts,ONCE, and be done /w it.
Does your router support "port forwarding"? that way your any request going to your router (which has a real internet address) will get forwarded to your server. you wouldn't be able to use izan.athome address from outside your router though.
if you dont wanna just setup the port forwarding, you may be able to specifiy by MAC an IP in your DHCP server.
yeah I'm not sure if a can turn off DHCP, thats what I would do if I wanted static IPs right?
Bookmarks