padmaja.rv at vodcalabs.com
2008-Feb-14 12:50 UTC
[CentOS] domain name display issue in linux pc
Hi, Thanks for your response on the kernel switching.I was away and could not reply immediately. Right now, I am facing a differentissue. I have to set up DNS server using BIND on Centos 4.3. When Itype the hostname on Centos, it shows: sipserver.vodcalocal.com But the cli prompt has root at sipserver~ meaning only the sipserver part of the hostname is displayed. whyis this so? What is the actual hostname then? I see in the /etc/sysconfig/network that thehostname is sipserver.vodcalocal.com the /etc/hosts file has the followingcontent: # Do not remove the following line, orvarious programs # that require network functionalitywill fail. 127.0.0.1 localhost.localdomain localhost sipserver 192.168.50.51 sipserver.vodcalocal.com The /etc/sysconfig/network has thefollowing config: NETWORKING=yes HOSTNAME=sipserver.vodcalocal.com I have seen in many forums that the/etc/sysconfig/network file has many other entries like domain name,gateway type, gateway ip etc, which are not present in myconfiguration. when i type $ domainname, i get-- (none) $ domainname -d vodcalocal.com $ domainname -f sipserver.vodcalocal.com Why does not the command domainnamelist the domain name? also domainname -f and domainname -d displaydifferent results. can the machine have the domainname and hostnamesame if I am going to run dns server on it? I run a SIP server on this PC whichneeds the domainname set but whenever I type echo $DOMAIN_NAME, itshows blank and I have to export the path variable DOMAIN NAME andset it. On another screen, I again dont see the domain name set. Howto set the domain name across all terminals and sessions andrestarts?an Thanks Padmaja -------------- next part -------------- An HTML attachment was scrubbed... URL: <lists.centos.org/pipermail/centos/attachments/20080214/726e1eb3/attachment.html>
Tomasz 'Zen' Napierala
2008-Feb-14 13:05 UTC
[CentOS] domain name display issue in linux pc
Thursday 14 February 2008 13:50:30 padmaja.rv at vodcalabs.com napisa?(a):> Hi, > > > Thanks for your response on the kernel switching.I was away and could not > reply immediately. > > > Right now, I am facing a differentissue. I have to set up DNS server using > BIND on Centos 4.3. When Itype the hostname on Centos, it shows: > sipserver.vodcalocal.com > But the cli prompt has root at sipserver~ meaning only the sipserver part of > the hostname is displayed. whyis this so? What is the actual hostname then?Put: export PS1=[\\u@\\H\ \\W]\\$ In any of your rc files Regards -- Tomasz Napiera?a Systems Architecture Engineer IT Infrastructure Department Allegro Team allegro.pl
On Thu, Feb 14, 2008 at 6:50 AM, <padmaja.rv at vodcalabs.com> wrote:> Right now, I am facing a different issue. I have to set up DNS server using > BIND on Centos 4.3. When I type the hostname on Centos, it shows: > > sipserver.vodcalocal.com > > But the cli prompt has root at sipserver ~ meaning only the sipserver part of > the hostname is displayed. why is this so? What is the actual hostname then? > I see in theWhat shows in your shell prompt does not necessarily indicate a networking problem. Is there a networking problem? Personally, I like having the short hostname in my prompt. domainname command is for NIS/YP, you want dnsdomainname. I don't see any problems with your configuration files. Whether to use or not use the FDQN in those files is not well defined. If hostname -s and hostname -f return the short and FDQN names respectively, then you should be good to go. -- Jeff
padmaja.rv at vodcalabs.com wrote:> > > Hi, > > > Thanks for your response on the kernel switching. I was away and could > not reply immediately. > > > Right now, I am facing a different issue. I have to set up DNS server > using BIND on Centos 4.3. When I type the hostname on Centos, it shows: > > sipserver.vodcalocal.com > > But the cli prompt has root at sipserver <mailto:root at sipserver> ~ meaning > only the sipserver part of the hostname is displayed. why is this so? > What is the actual hostname then? I see in theThe actual hostname is sipserver, the domain name is vodcalocal.com, so the FQDN is sipserver.vodalocal.com. The shell is configured by default to show only the hostname part. It is configurable (see Thomas' post). Ugo
padmaja.rv at vodcalabs.com wrote:> > the /etc/hosts file has the following content: > > > # Do not remove the following line, or various programs > > # that require network functionality will fail. > > 127.0.0.1 localhost.localdomain localhost sipserver > > 192.168.50.51 sipserver.vodcalocal.com >take 'sipserver' /off/ the localhost line and add it to the regular IP line. I'm not sure /why/ anacdonda or whatever insists on doing this, but using your hostname as localhost is generally quite wrong and can result in all sorts of odd little behaviors.