[CentOS] How to set hostname and domainnmae in CentOS 7?

Tue Apr 5 19:49:09 UTC 2016
Mark Haney <mark.haney at vifprogram.com>

vi or your text editor of choice. Though there should be a 'domainname'
command to set it as well, though I just prefer editing /etc/hosts directly.



On Tue, Apr 5, 2016 at 3:24 PM, Joe Smithian <joe.smithian at gmail.com> wrote:

> We can permanently set hostname using  hostnamectl set-hostname. How can we
> permanently set *domain name* in CentOS 7?
> I found an article
> <
> http://unix.stackexchange.com/questions/239920/how-to-set-the-fully-qualified-hostname-on-centos-7-0
> >
> that recommended setting FQDN using hostnamectl. Is that the right way to
> set hostname and domainname at the same time using *hostnamectl
> set-hostname* command?
>
>  Running *hostnamectl set-hostname* will set the hostname in*
> /etc/hostname*
> but it doesn't change */etc/hosts*. What's the proper way of adding
> hostname and FQDN to */etc/hosts *in CentOS 7?
>
> Thanks,
>
> Joe
> _______________________________________________
> CentOS mailing list
> CentOS at centos.org
> https://lists.centos.org/mailman/listinfo/centos
>



-- 

Mark Haney ::: Senior Systems Engineer
*VIF* *International Education*
P.O. Box 3566 ::: Chapel Hill, N.C. 27515 ::: USA
919-265-5006 office

Global learning for all.
www.viflearn.com
Find VIF on Facebook <http://facebook.com/VIFInternationalEducation> |
Twitter <https://twitter.com/vifglobaled> | LinkedIn
<http://www.linkedin.com/company/vif-international-education>

Recognized as a ‘Best for the World’
<http://bestfortheworld.bcorporation.net/> B Corp!