LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-28-2012, 08:18 AM   #1
suresh.k
Member
 
Registered: Aug 2011
Location: Hyderabad, AP, India
Distribution: centos, Ubuntu
Posts: 163
Blog Entries: 1

Rep: Reputation: Disabled
How to set domain name in local network


Hi,
I searched a lot in Google but i didn't understand, can u people please help me to solve my problem.

In my office local network we have a 20 computers with linux OS,
i want to set every computer with host and domain name,
like user1@example.com, user2@example.com, user3@example.com etc...

How can i setup like this,

Thanks
Suresh
 
Old 06-28-2012, 09:52 AM   #2
tronayne
Senior Member
 
Registered: Oct 2003
Location: Northeastern Michigan, where Carhartt is a Designer Label
Distribution: Slackware 32- & 64-bit Stable
Posts: 3,541

Rep: Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065
Uh, no you don't want to do it quite like that.

Each machine should have its own unique name and domain, like fubar.com, snafu.com, pita.com and the like.
[EDIT]
The domain name is unique to your network, not to each machine; e.g., com, org, info, or whatever you've been assigned -- don't want any confusion there.
[/EDIT]
If you're going to use fixe-IP addressing for the individual servers (a Good Ida), those addresses would be something like this
Code:
fubar.com 192.168.1.10
sanfu.com 192.168.1.20
pita.com  192.168.1.30
and so on. Those addresses depend upon your network configuration.

If you're using DHCP, they still need unique names similar to the above.

The advantage of fixed-IP is that the servers (machines) can find each other easily -- you add the names and addresses to /etc/hosts on each server like this:
Code:
# For loopbacking.
127.0.0.1		localhost
192.168.1.10		fubar.com fubar
192.168.1.15		InkJet
192.168.1.20		snafu.com snafu
192.168.1.30		pita.com pita
That line for InkJet is the address of a system-wide network printer that has a fixed-IP address.

If you're on fubar.com, you can then simply connect to, say, snafu.com with SSH
Code:
ssh snafu
would get you there -- the purpose of having "fubar.com" and "fubar" is that the servers can be addressed either way (the full name, fubar.com or the alias fubar). See the manual page for hosts.

You should have some sort of network configuration utility on your servers that is used to assign a name and domain, an address, a gateway address (your severs should be connected to a switch or router, the gateway address is the address of the switch or router) for fixed-IP (also for DHCP but the settings are somewhat different).

With 20 serves you may have different subnet addresses; i.e., you may have a subnet 1 and subnet 2 which would make the addresses 192.168.1.10 and 192.168.2.10 (the 1 and 2 are the subnets) simply because you may not have enough ports on a switch or router to handle 20 servers (many routers are 4-, 8, or 16 ports, some are 32 ports). If you're using wi-fi, that's different and you need to check the manual for your wi-fi equipment.
[EDIT]
It is not necessary that you would have different subnet addresses; you could (as suggested by @acid_kewpie below) simply plug in another switch -- you would need to set the gateway address for that additional switch and on whatever servers are wired to that switch (the gateway addresses of each router or switch must be unique on the network).
[/EDIT]

You may want to refer to http://www.yolinux.com/TUTORIALS/Lin...etworking.html for more information.

Hope this helps some.

Last edited by tronayne; 06-28-2012 at 10:43 AM. Reason: Forgot the link; clean up potentially confusing syntax
 
Old 06-28-2012, 09:53 AM   #3
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
if you're not doing anything with an AD like membership environment then you just call each machine whatever you feel like. they won't implicitly "do" anything, which is probably why you can't any docs about it, as there's nothing to do...

---------- Post added 28-06-12 at 03:54 PM ----------

each machine needs its own domain name?? WTF? that is *NOT* a good idea at all

you would generally use a naming comvention like:

host1.domain.com
host2.domain.com
host3.domain.com

as for the "user@" part of the name... what does that mean to you? What do you expect these things to actually DO?

I also feel it's wroth pointing out that the number of ports on a switch does not relate to the number of hosts allowed on a network at all. Just plug another switch in if you wish.

Last edited by acid_kewpie; 06-28-2012 at 09:57 AM.
 
Old 06-28-2012, 10:31 AM   #4
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,974

Rep: Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623
You are mixing up how to use a domain name. example.com is a common form of a FQDN. It is a (un)registered name that is normally resolved to an IP name by DNS.

To name a computer you don't need a domain. You simply name them and use some means to access the local ip by name if you wish. Hosts file is one way to add in computer name to ip address.
 
Old 06-29-2012, 01:27 AM   #5
suresh.k
Member
 
Registered: Aug 2011
Location: Hyderabad, AP, India
Distribution: centos, Ubuntu
Posts: 163

Original Poster
Blog Entries: 1

Rep: Reputation: Disabled
I have given in host name as suresh in one compueter and rajesh in another computer but iam not able to ping or ssh each computers with hostname.

suresh /etc/hosts file consistes this :-
127.0.0.1 localhost
192.168.10.1 suresh

Another computer rajesh /etc/hosts file consists:-
127.0.0.1 localhost
192.168.10.2 rajesh

user@ -- sorry for typo it is host@, host2@domain.com,
means i want to create a localdomain in my network with example.com
for localdomain i think no need of register domain
i want to use same domain for all computers.
so that i can ssh or ping with suresh@example.com

Thanks
Suresh
 
Old 06-29-2012, 01:46 AM   #6
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
Again I think you are taking the notion of a domain to be much more than it actually is. You certainly can't ping "user@domain.com" that just makes no sense. For hitting a server from another one, then you can either populate all host files on all machines, or set up a DNS server. If you want a VERY lightweight server you can try the following:

install dnsmasq
populate /etc/hosts on a machine chosen to be the DNS server
start dnsmasq
Configure /etc/resolv.conf on all other machines to use that server with a "domain" option also set to your local domain name of choice.
 
Old 06-29-2012, 03:52 PM   #7
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,624

Rep: Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964
Quote:
Originally Posted by suresh.k View Post
I have given in host name as suresh in one compueter and rajesh in another computer but iam not able to ping or ssh each computers with hostname.

suresh /etc/hosts file consistes this :-
127.0.0.1 localhost
192.168.10.1 suresh

Another computer rajesh /etc/hosts file consists:-
127.0.0.1 localhost
192.168.10.2 rajesh

user@ -- sorry for typo it is host@, host2@domain.com, means i want to create a localdomain in my network with example.com for localdomain i think no need of register domain i want to use same domain for all computers. so that i can ssh or ping with suresh@example.com
Please re-read what you posted, and think about it.

On suresh, you have only told it what the address of ITSELF is...same with rajesh. You need to put the rajesh entry on the suresh machine, and vice-versa, so then they will know about each other, and will let you ping it by name. And dnsmasq is the best way to go, as acid_kewpie said.
 
1 members found this post helpful.
Old 07-02-2012, 03:19 AM   #8
suresh.k
Member
 
Registered: Aug 2011
Location: Hyderabad, AP, India
Distribution: centos, Ubuntu
Posts: 163

Original Poster
Blog Entries: 1

Rep: Reputation: Disabled
Ok ok thanks for ur replays..
 
  


Reply



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
DNSMasq - dnslookup build.domain.local works but ping build.domain.local doesnt mustaghattack Linux - Server 2 03-01-2010 09:00 PM
local network, domain and modem setup page triange :D caho Linux - Server 1 03-03-2009 12:43 AM
BIND for local domain for small network jst1 Linux - Server 2 04-04-2008 09:59 AM
Local network/domain setup ? CloudyWizzard Debian 2 08-31-2007 08:17 AM
passwd: can't get local yp domain: Local domain name not set powah Linux - Security 4 06-08-2006 09:59 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:19 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration