LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices

Reply
 
Search this Thread
Old 11-29-2007, 03:29 PM   #1
patitoconejita
Member
 
Registered: Nov 2004
Location: Winnipeg, MB
Distribution: Debian
Posts: 42

Rep: Reputation: 15
how to setup home network


Hi,

I have a 4 computers at home that are hooked up through a router. They all have the same domain name, of course with different host names. I can ping to all of them by IP address, but I wish to be able to refer to them by FQDN. Any tips welcome!
 
Old 11-29-2007, 04:05 PM   #2
MQMan
Member
 
Registered: Jan 2004
Location: Los Angeles
Distribution: Slack64 13.37
Posts: 535

Rep: Reputation: 36
Do they have fixed IPs. If so, then you just need to add a "hosts" file to each, containing the IP/Name of the others. In Linux, the file is /etc/hosts. In Winblows it's C:\WINDOWS\system32\drivers\etc\hosts.

If they have dynamic IPs, then the Router would have to run a DNS tied to it's DHCP. Most, if not all, don't support this. They just pass DNS requests through to an external DNS.

Cheers.
 
Old 11-29-2007, 04:10 PM   #3
patitoconejita
Member
 
Registered: Nov 2004
Location: Winnipeg, MB
Distribution: Debian
Posts: 42

Original Poster
Rep: Reputation: 15
Thank you. This is in Debian unstable, so I'd be interested to know if there's a Debian way of doing this. I'm not sure if these are static IPs or not, but I'll find out. If I want to make the FQDNs be accesible from outside the router, that's a whole different story isn't it? Thanks.
 
Old 11-29-2007, 04:47 PM   #4
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654
Even if these hosts get their address from DHCP most NAT routers will remember the IP assigned and not change it unless you change a NIC card (which changes the MAC address). So for 5 hosts, editing the hosts file is the best solution. Look in your /etc/nsswitch.conf file. On the "hosts:" line, "files" is listed first. This line is in sync with /etc/host.conf; "order hosts, bind". Some people run their own nameserver (DNS) for the LAN. For 5 hosts, that is just to much work. For some NAT routers, you can use the IP address of the router as the nameserver. This won't work for my Linksys wireless router however.

For only 5 hosts, static addresses would be just as managable. Assign them outside the address range that the router uses to assign addresses. For a Linksys NAT router, that would be in the ranges 192.168.1.2-99 and 192.168.1.150-192.168.1.254.
 
Old 11-29-2007, 04:54 PM   #5
patitoconejita
Member
 
Registered: Nov 2004
Location: Winnipeg, MB
Distribution: Debian
Posts: 42

Original Poster
Rep: Reputation: 15
So are you saying the easiest would be to just modify the /etc/hosts file at each computer using the IP addresses I get from ifconfig, and putting the info for the other computers in it? Thanks.
 
Old 11-29-2007, 10:26 PM   #6
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654
Yes, but if you want to go from using a dhcp assigned address to a fixed address, you may want to change it's address first. A Linksys NAT router starts at 192.168.1.100, and assigns up to 50 IP addresses. These are the defaults and can be modified in the setup. However with only 5 devices, you have plenty of IP address to choose from outside of 195.168.1.100-149.

My host file contains an entry like:
192.168.1.100 hpamd64.jesnet hpamd64

If you wanted you could even add www.linuxquestions.org to your hosts file with maybe an alias of "lq". Then it would be a few milliseconds quicker and easier to reach your favorite website.

Last edited by jschiwal; 11-29-2007 at 10:27 PM.
 
Old 11-30-2007, 06:14 AM   #7
patitoconejita
Member
 
Registered: Nov 2004
Location: Winnipeg, MB
Distribution: Debian
Posts: 42

Original Poster
Rep: Reputation: 15
Cool, I just checked the IPs of all the computers and modified their /etc/hosts like this. I can now ping them, ssh to/from them and what not. IIUC, one can just add any number of IP/FQDN in that file to make life easier contacting them? I hope there's no security issue doing that. It's very handy! BTW, is NFS the best way to go to access each computer's filesystem from any of the computers? Thanks again for the pointers!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to setup a home Network ? _GOGO_ Linux - Networking 9 10-03-2007 01:37 AM
Home network setup with network firewall/router Gates1026 Linux - Networking 4 01-17-2005 08:26 PM
Setup network at home?? Pedroski Linux - Hardware 1 04-24-2004 09:17 AM
how do I setup a home network? Lindy Linux - Networking 4 12-09-2003 03:15 PM
Newbie wanna setup up a linux network on existing home network... marvc Linux - Networking 3 03-19-2003 09:02 PM


All times are GMT -5. The time now is 06:26 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration