Hi, I recently made a CentOS install on a machine with an unsupported network card. I had to add the driver for it later, once I finished the install. For now I have this: [kikinovak at localhost ~]$ hostname --fqdn localhost.localdomain Q: how would I change this to something like calimero.local? Here's what I *would* do, but I prefer to ask before. 1) edit /etc/sysconfig/network and edit this line: HOSTNAME=calimero.local 2) add a line to /etc/hosts like this: # Do not remove the following line, or various programs # that require network functionality will fail. 127.0.0.1 localhost.localdomain localhost 127.0.0.1 calimero.local calimero ::1 localhost6.localdomain6 localhost6 Please correct me if I'm wrong. cheers, Niki Kovacs
Hello, you can do it from here. go through System >> Network >> Hosts edit host name from here. all things you have done till now are correct. On Sat, Sep 13, 2008 at 11:36 AM, Niki Kovacs <contact at kikinovak.net> wrote:> Hi, > > I recently made a CentOS install on a machine with an unsupported network > card. I had to add the driver for it later, once I finished the install. For > now I have this: > > [kikinovak at localhost ~]$ hostname --fqdn > localhost.localdomain > > Q: how would I change this to something like calimero.local? > > Here's what I *would* do, but I prefer to ask before. > > 1) edit /etc/sysconfig/network and edit this line: > > HOSTNAME=calimero.local > > 2) add a line to /etc/hosts like this: > > # Do not remove the following line, or various programs > # that require network functionality will fail. > 127.0.0.1 localhost.localdomain localhost > 127.0.0.1 calimero.local calimero > ::1 localhost6.localdomain6 localhost6 > > Please correct me if I'm wrong. > > cheers, > > Niki Kovacs > _______________________________________________ > CentOS mailing list > CentOS at centos.org > http://lists.centos.org/mailman/listinfo/centos >-- Thanks and Regards, Kapil Singh Kushwah Linux System/Network Administrator Hotwax Media Inc. Indore,(M.P) INDIA -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.centos.org/pipermail/centos/attachments/20080913/b8d55d19/attachment-0002.html>
kapil singh wrote:> Hello, > > you can do it from here. > go through System >> Network >> Hosts > > edit host name from here.or, edit /etc/sysconfig/network and set .... HOSTNAME=whateverfqdn.com since I never even start any GUI on my servers, I find this much more useful.
Niki Kovacs wrote:> I recently made a CentOS install on a machine with an unsupported > network card. I had to add the driver for it later, once I finished the > install. For now I have this:See http://www.yolinux.com/TUTORIALS/LinuxTutorialNetworking.html and look at the section titled "Changing the host name:"
on 9-12-2008 11:06 PM Niki Kovacs spake the following:> Hi, > > I recently made a CentOS install on a machine with an unsupported > network card. I had to add the driver for it later, once I finished the > install. For now I have this: > > [kikinovak at localhost ~]$ hostname --fqdn > localhost.localdomain > > Q: how would I change this to something like calimero.local? > > Here's what I *would* do, but I prefer to ask before. > > 1) edit /etc/sysconfig/network and edit this line: > > HOSTNAME=calimero.local > > 2) add a line to /etc/hosts like this: > > # Do not remove the following line, or various programs > # that require network functionality will fail. > 127.0.0.1 localhost.localdomain localhost > 127.0.0.1 calimero.local calimeroThis should be the ip address of your local adapter, not 127.0.0.1> ::1 localhost6.localdomain6 localhost6 > > Please correct me if I'm wrong. > > cheers, > > Niki KovacsEverything else seems OK. -- MailScanner is like deodorant... You hope everybody uses it, and you notice quickly if they don't!!!! -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 250 bytes Desc: OpenPGP digital signature URL: <http://lists.centos.org/pipermail/centos/attachments/20080915/14e0edda/attachment-0002.sig>
On Sat, Sep 13, 2008 at 08:06:46AM +0200, Niki Kovacs wrote:> > I recently made a CentOS install on a machine with an unsupported > network card. I had to add the driver for it later, once I finished the > install. For now I have this: > > [kikinovak at localhost ~]$ hostname --fqdn > localhost.localdomain > > Q: how would I change this to something like calimero.local? > > Here's what I *would* do, but I prefer to ask before. > > 1) edit /etc/sysconfig/network and edit this line: > > HOSTNAME=calimero.local > > 2) add a line to /etc/hosts like this: > > # Do not remove the following line, or various programs > # that require network functionality will fail. > 127.0.0.1 localhost.localdomain localhost > 127.0.0.1 calimero.local calimero > ::1 localhost6.localdomain6 localhost6 > > Please correct me if I'm wrong. >Lots of replies to this already. The critical thing to understand is that it is the network interfaces that have names not the box. Sendmail and some other tools look for host names that have at least one dot in them. Thus localhost.localdomain gets paired with localhost as a CNAME. This line: 127.0.0.1 localhost.localdomain localhost associated the ipaddress 127.0.0.1 with the name localhost.localdomain and its CNAME/ alias localhost. This second line is interesting 127.0.0.1 calimero.local calimero It appears to redefine the relationship with 127.0.0.1 If you were programing and had two lines foo="this" foo="that" You would expect the second assignment for foo to win and the second to be lost. It is possible that the pair of lines acts a bit like a =+ assignment I would have to check. A better line would be 127.0.0.1 localhost.localdomain calimero.local calimero or perhaps... 127.0.0.1 localhost.localdomain calimero.localdomain calimero These make it clear that you want all four names (long and short) associated with 127.0.0.1 Having HOSTNAME set in places like /etc/sysconfig/network with a line like: HOSTNAME=calimero has advantages in lots of ways... with wireless and other dynamic situations where plugging a wire in or wired connection to hot spots and more are possible keeping the 'hostname' handy makes sense for a handful of reasons. Link local zeroconfig .... It also permits the host to have the 'short' CNAME of calimero and still discover its fully qualified (lots of dots) host name. One advantage of caching the name of the host permits the like of dynamic DNS to work.... and lots more like on line off line operation for mail composition and more. In the case of swapping out the network card you need to look at /etc/sysconfig/network.scripts and /etc/modprobe.conf with a multiple network card admin hat on. It may be as simple as removing the old network interface (old hardware) and adding a new one with the same name. The graphical tools may make this way easy... In the system and in the internet there are commonly aliases for things. For example eth0 is the common alias (sometimes defined in /etc/modprobe.conf) for ethernet ports. See also /etc/sysconfig/network-scripts/ifcfg-eth0 for lines like "DEVICE=eth0" Aliases permit lots of layers of scripts to run without knowing the specific driver name. If you reflect back on your initial install, you were asked if the host name was obtained from DHCP or was set (known) locally. So "it depends"... on decisions you made and also external decisions. -- T o m M i t c h e l l Found me a new hat, now what?