LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 03-25-2014, 09:51 AM   #1
NotionCommotion
Member
 
Registered: Aug 2012
Posts: 543

Rep: Reputation: Disabled
How to name servers?


I have two servers(server1 and server2). Both have static IPs 192.168.0.101 and 192.168.0.102. My router's IP is 192.168.0.1.

I have two domain names (domainname1.com and domainname2.com) pointing to my IP address, and use Apache name based virtual servers both on server1.

When initialing installing Centos, do I pick a host name like server1.domainname1.com, or just server1?

Should I add the following to both servers /etc/sysconfig/network?
Code:
GATEWAY=192.168.0.1
Should I added the following to server1's /etc/sysconfig/network-scripts/ifcfg-eth0, and similar to server2?
Code:
IPADDR=192.168.0.101
NETMASK=255.255.255.0
#Changed BOOTPROTO from dhcp to static
BOOTPROTO "static"
Should I add the following to server1's /etc/hosts file, and similar to server2?
Code:
192.168.0.101   server1.domainname1.com     server1
When configuring postfix, do I use myhostname = server1.domainname1.com?

Any additional clarification on why you recommend making any changes would be much appreciated.

Thank you
 
Old 03-25-2014, 09:54 AM   #2
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 3,836

Rep: Reputation: 1360Reputation: 1360Reputation: 1360Reputation: 1360Reputation: 1360Reputation: 1360Reputation: 1360Reputation: 1360Reputation: 1360Reputation: 1360
I typically name my server according to my intranet naming scheme. Ie "server1.intranet.lan" and then set up vhosts to accept @ 'server1.internet.com'

Then when using postfix, I use the internet name again 'server1.internet.com' because mail from the intranet name would be useless to anyone outside.
 
1 members found this post helpful.
Old 03-25-2014, 10:01 AM   #3
NotionCommotion
Member
 
Registered: Aug 2012
Posts: 543

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by szboardstretcher View Post
I typically name my server according to my intranet naming scheme. Ie "server1.intranet.lan"....
Thanks szboardstretcher,

Could you elaborate intranet naming scheme? Could "intranet.lan" be anything I want such as "MichaelsNetwork"? How do I set the name in the servers? Or is this just set in the router (and if so, do you need to change all your server names if you change your router name)? Is server1.MichaelsNetwork just a string where the server doesn't break apart as "server1" and "MichaelsNetwork"?

Last edited by NotionCommotion; 03-25-2014 at 10:05 AM. Reason: Added part about changing router name
 
Old 03-25-2014, 10:18 AM   #4
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 3,836

Rep: Reputation: 1360Reputation: 1360Reputation: 1360Reputation: 1360Reputation: 1360Reputation: 1360Reputation: 1360Reputation: 1360Reputation: 1360Reputation: 1360
Quote:
Originally Posted by NotionCommotion View Post
Thanks szboardstretcher,

Could you elaborate intranet naming scheme? Could "intranet.lan" be anything I want such as "MichaelsNetwork"? How do I set the name in the servers? Or is this just set in the router (and if so, do you need to change all your server names if you change your router name)? Is server1.MichaelsNetwork just a string where the server doesn't break apart as "server1" and "MichaelsNetwork"?
Your intranet naming scheme can be anything you would like. I use 'somerandomname.lan' with the .lan domain to remind me that it is internal.

you can set your intranet server name in /etc/sysconfig/network at HOSTNAME=

now, this is ALL assuming that you have a dns server, which is the server that maps names to ip addresses. then you set all of your internal equipment to point to that dns server, and anytime you call out yourthing.lan, every device will realize that its 192.168.0.100 that you are talking about.
 
1 members found this post helpful.
Old 03-25-2014, 11:18 AM   #5
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974
A physical machine would usually be named for the kind of function it is performing at it's most specific. You shouldn't be bringing it's name up to the level of a specfici website on it etc. Webserver01 is, for example, about as detailed as I'd ever suggest going in terms of its role. It's physical location (geographical or network zone wise) is far more important from the literal hardware perspective.
 
Old 03-25-2014, 11:42 AM   #6
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 2,171

Rep: Reputation: 752Reputation: 752Reputation: 752Reputation: 752Reputation: 752Reputation: 752Reputation: 752
Ours at work are named logically, letters for function, then a number for the data center and an increment number, so we'd have web servers like web002/web003/etc. in the primary datacentre and web102/web103/etc. in the secondary datacentre.

The office infrastructure is African wildlife, with windows servers named after fish.

My personal servers are named after car marques based on location, so my EU Server from a German company is AUDI, and my US server is FORD

There's any number of naming conventions out there, just pick what works for you.
 
1 members found this post helpful.
Old 03-25-2014, 11:48 AM   #7
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 3,836

Rep: Reputation: 1360Reputation: 1360Reputation: 1360Reputation: 1360Reputation: 1360Reputation: 1360Reputation: 1360Reputation: 1360Reputation: 1360Reputation: 1360
If you want to get into corporate naming conventions then:

function-somenumber.dev/prod.location.bldg-floor-rack-space.company.lan

ie:

apacheweb-01.dev.us.d-09-16b-12.company.lan
dns-05.prod.eu.1-01-41-02.company.lan


Its a mouthful, BUT, there is no question of what/where it is. The rest of the information will be in the /etc/motd file.
 
2 members found this post helpful.
Old 03-25-2014, 11:59 AM   #8
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974
Quote:
Originally Posted by szboardstretcher View Post
If you want to get into corporate naming conventions then:

function-somenumber.dev/prod.location.bldg-floor-rack-space.company.lan

ie:

apacheweb-01.dev.us.d-09-16b-12.company.lan
dns-05.prod.eu.1-01-41-02.company.lan


Its a mouthful, BUT, there is no question of what/where it is. The rest of the information will be in the /etc/motd file.
Until it's moved and it's too business critical and full of voodoo and black magic to rebuild / rename.
 
Old 03-25-2014, 12:09 PM   #9
NotionCommotion
Member
 
Registered: Aug 2012
Posts: 543

Original Poster
Rep: Reputation: Disabled
Thank you all. So far I've done the following:

Code:
#Disable NetworkManager
chkconfig NetworkManager off

#Stop NetworkManager
service NetworkManager stop
Added the following to /etc/sysconfig/network:
Code:
HOSTNAME=michaels.lan
GATEWAY=192.168.0.1
Added the following to /etc/sysconfig/network-scripts/ifcfg-eth0:
Code:
IPADDR=192.168.0.215
NETMASK=255.255.255.0
change BOOTPROTO from "dhcp" to "static"
change NM_CONTROLLED from "yes" to "no"
Add the following to /etc/hosts (Yes, I now know it is better to use a server name describing its physical location or function, and not hardware, but this is only for testing):
Code:
192.168.0.215   newlaptop.michaels.lan     newlaptop

I was about to add some nameservers to /etc/resolv.conf, but when I did, it showed the following:
Code:
# Generated by NetworkManager
search lan


# No nameservers found; try putting DNS servers into your
# ifcfg files in /etc/sysconfig/network-scripts like so:
#
# DNS1=xxx.xxx.xxx.xxx
# DNS2=xxx.xxx.xxx.xxx
# DOMAIN=lab.foo.com bar.foo.com
Questions
  1. Should I add name servers to /etc/resolv.conf, or /etc/sysconfig/network-scripts/ifcfg-eth0, or some other file? Edit, I added them to /etc/resolve.conf as everything I read says this is what you are suppose to do, but when I restart the network, they vanish. Edit2. I disabled networkmanager and it seems to work. Is this how I should be doing this?
  2. What nameserver should I add? 192.168.1.1 for my router? 8.8.8.8 and 8.8.4.4 for Google?
  3. Should I add a bind9 DNS server (note that I am interested in learning)
  4. What does "search lan" mean in /etc/resolv.conf?
  5. What is "DOMAIN=lab.foo.com" all about in /etc/sysconfig/network-scripts?
  6. Anything I am doing wrong?
  7. What else should I be doing?

Thanks again

Last edited by NotionCommotion; 03-25-2014 at 12:54 PM. Reason: Add part nameservers dissapearing
 
Old 03-25-2014, 12:36 PM   #10
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 3,836

Rep: Reputation: 1360Reputation: 1360Reputation: 1360Reputation: 1360Reputation: 1360Reputation: 1360Reputation: 1360Reputation: 1360Reputation: 1360Reputation: 1360
Quote:
Originally Posted by acid_kewpie View Post
Until it's moved and it's too business critical and full of voodoo and black magic to rebuild / rename.
Maybe old servers were like that. But we don't do anything from the command line any more. Logs go to graylog/kibana,. and Chef configuration management helps us with standardizing deployments so that no black magic/voodoo/hidden config changes can be applied to the server without a rewrite of the chef cookbooks.

Configuration management/deployment is the Best thing since sliced pizza. Also, no reason to move services unless the server is bad, in my case its all cloud/VM so its a wash. Migrate VM's temporarily, Take out server X, replace it, migrate back VM's. No name changes.
 
Old 03-26-2014, 12:29 PM   #11
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974
Quote:
Originally Posted by szboardstretcher View Post
Maybe old servers were like that. But we don't do anything from the command line any more. Logs go to graylog/kibana,. and Chef configuration management helps us with standardizing deployments so that no black magic/voodoo/hidden config changes can be applied to the server without a rewrite of the chef cookbooks.

Configuration management/deployment is the Best thing since sliced pizza. Also, no reason to move services unless the server is bad, in my case its all cloud/VM so its a wash. Migrate VM's temporarily, Take out server X, replace it, migrate back VM's. No name changes.
Sounds great. Sadly I'm currently working on a government contract!
 
Old 03-26-2014, 01:47 PM   #12
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 2,171

Rep: Reputation: 752Reputation: 752Reputation: 752Reputation: 752Reputation: 752Reputation: 752Reputation: 752
Quote:
Originally Posted by acid_kewpie View Post
Sounds great. Sadly I'm currently working on a government contract!
And let me guess, you have to work within an ITIL framework?
 
Old 03-26-2014, 03:53 PM   #13
NotionCommotion
Member
 
Registered: Aug 2012
Posts: 543

Original Poster
Rep: Reputation: Disabled
Hey you three, No hijacking posts without commenting on http://www.linuxquestions.org/questi...6/#post5140981
 
Old 03-26-2014, 04:03 PM   #14
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 3,836

Rep: Reputation: 1360Reputation: 1360Reputation: 1360Reputation: 1360Reputation: 1360Reputation: 1360Reputation: 1360Reputation: 1360Reputation: 1360Reputation: 1360
Quote:
Should I add name servers to /etc/resolv.conf, or /etc/sysconfig/network-scripts/ifcfg-eth0, or some other file? Edit, I added them to /etc/resolve.conf as everything I read says this is what you are suppose to do, but when I restart the network, they vanish. Edit2. I disabled networkmanager and it seems to work. Is this how I should be doing this?
Yes and no. Depends. Resolv.conf is the old way of doing things. Using the networkmanager and ifcfg-eth0 scripts is the new way. Either way,. just stick with it completely. Don't mix and match. You should be good using resolv.conf if you have removed references from the ifcfg files and disabled networkmanager.
Quote:
What nameserver should I add? 192.168.1.1 for my router? 8.8.8.8 and 8.8.4.4 for Google?
If you have set up and configured a nameserver, then use that IP address. If you have NOT done that. Then use 4.2.2.3, 4.2.2.4, 8.8.8.8, 8.8.4.4. But realize that any cool names that you have come up with, such as myshit.myplace.mylanta is not going to resolve unless you have a private DNS server set up.
Quote:
Should I add a bind9 DNS server (note that I am interested in learning)
No. I deal with bind servers everyday and I hate them. Use powerDNS or dnsmasq for ease of set up and management in a small lan.
Quote:
What does "search lan" mean in /etc/resolv.conf?
if you type 'ping myshiznit' then it will first try pinging 'shiznit' then it will try pinging 'shiznit.lan' basically any appended names you want to search for, add them here. for example: search thisismylan.org will cause it to ping 'shiznit' and upon failing 'shiznit.thisismylan.org'
Quote:
What is "DOMAIN=lab.foo.com" all about in /etc/sysconfig/network-scripts?
Sets the DNS domain part of the hostname. type 'hostname -d' to see it.
 
1 members found this post helpful.
Old 03-26-2014, 04:18 PM   #15
NotionCommotion
Member
 
Registered: Aug 2012
Posts: 543

Original Poster
Rep: Reputation: Disabled
Thanks szboardstretcher,

I was kidding about that post hijacking, but very much appreciate your response.

Would you recommend keeping with networkmanager and ifcfg-eth0 scripts? I read a couple posts where the author felt it should only be used with laptops and such, and not servers.

I am going to build and then flatten the server I am making a couple of times (kind of a learning process), so I am happy to go either way.

Thanks again, Michael
 
  


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
mysqld_multi errors when starting servers, servers start when run manually jason.rohde Linux - Server 2 10-29-2011 09:18 AM
Are IBM servers the Best Servers, for a music download website.? mixhypnatist General 30 09-16-2009 10:26 PM
Setting name servers on multiple servers centosfan Linux - Server 3 01-23-2008 04:43 PM


All times are GMT -5. The time now is 02:40 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration