[NTLUG:Discuss] Host / Domain Name

Charles Cashion papacharles at dunjas.com
Fri Sep 2 12:33:03 CDT 2005


Dennis Rice wrote:
> When using RH / Fedora, I can issue the command 'hostname', and as I 
> entered the information, I get back the hostname and domain name, as I 
> entered them during installation.  If I query the system for the domain 
> name, I get nothing.
> 
> If I issue the command 'hostname -f', I get back "unknown host", and 
> likewise for 'hostname -d'.  I would have assumed that these commands 
> would have trunkated the fqdn.
> 
> If I issue the command 'domainname', I get back "(none)".  When doing a 
> man on domainname, I get the page for hostname.
> 
> I can assign a domain name with the domainname command, but it is not 
> permanent.
> 
> Where does RH / Fedora store the domain name?  Would appreciate if 
> someone could provide insight and help my knowledge of this situation.  
> Want to document it in my book.
> 
> Thanks,
> Dennis Rice
> dennis at dearroz.net

Since I believe this info is stored under /etc, I did the following...

[ccashion at newdawg etc]$ find . -type f -exec grep newdawg {} \; -print

HOSTNAME=newdawg.3316pony.com
./sysconfig/network

DHCP_HOSTNAME=newdawg.3316pony.com
./sysconfig/networking/profiles/default/ifcfg-eth0

127.0.0.1 newdawg.3316pony.com host localhost.localdomain localhost
./sysconfig/networking/profiles/default/hosts

DHCP_HOSTNAME=newdawg.3316pony.com
./sysconfig/networking/devices/ifcfg-eth0

DHCP_HOSTNAME=newdawg.3316pony.com
./sysconfig/network-scripts/ifcfg-eth0

send host-name "newdawg.3316pony.com";  # temporary RHL ifup addition
./dhclient-eth0.conf

127.0.0.1 newdawg.3316pony.com host localhost.localdomain localhost
./hosts

PonyPrinter|PonyPrinter:rm=newdawg.3316pony.com:rp=PonyPrinter:
./printcap

[ccashion at newdawg etc]$ hostname -f
newdawg.3316pony.com

[ccashion at newdawg etc]$ hostname -d
3316pony.com

[ccashion at newdawg etc]$ domainname
(none)

I had *MANY* lines ending with "Permission denied" which I manually 
removed. Is there a grep option that will remove those lines before
they are printed?
--
Charles




More information about the Discuss mailing list