Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Linux basic command-display domain name ypdomainname

2025-04-08 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

ypdomainname

The ypdomainname directive displays the host domain name returned by the function "getdomainname," and can also be used to set a host NIS/YP domain name.

This command applies to Red Hat, RHEL, Ubuntu, CentOS, SUSE, openSUSE, Fedora.

1. Grammar

ypdomainname [-v]

2. Option list

option

description

--help

Show Help Documentation

--version

Show command version

-v

Show detailed execution process

3. Examples

Show host domain name

[root@localhost ~]# ypdomainname //Show domain name

www.weijie.com

[root@localhost ~]# ypdomainname www.david.com domain name

[root@localhost ~]# ypdomainname //Show domain name

www.david.com

nisdomainname

The nisdomainname directive displays the host domain name returned by the function "getdomainname," and can also be used to set a host NIS/YP domain name.

This command applies to Red Hat, RHEL, Ubuntu, CentOS, SUSE, openSUSE, Fedora.

1. Grammar

nisdomainname [-v]

2. Option list

option

description

--help

Show Help Documentation

--version

Show command version

-v

Show detailed execution process

3. Examples

Show host domain name

[root@localhost ~]# nisdomainname //Show domain name

www.david.com

[root@localhost ~]# nisdomainname www.weijie.com domain name

[root@localhost ~]# nisdomainname //Show domain name

www.weijie.com

domainname

The domainname directive displays the host domain name returned by the function "getdomainname," and can also be used to set a host domain name.

This command applies to Red Hat, RHEL, Ubuntu, CentOS, SUSE, openSUSE, Fedora.

1. Grammar

domainname [-v] [-F filename] [name]

2. Option list

option

description

--help

Show Help Documentation

--version

Show command version

-v

Show detailed execution process

-F | --file filename

Read host domain name from specified file

3. Examples

Show host domain name

[root@localhost ~]# domainname -v

getdomainname()=`(none)'

(none)

[root@localhost ~]# domainname www.david.com

You have new mail in /var/spool/mail/root

[root@localhost ~]# domainname

www.david.com

dnsdomainname

dnsdomainname prints the domain portion of the FQDN(fully qualified domain name). The full FQDN of the system is returned as "hostname --fqdn".

This command applies to Red Hat, RHEL, Ubuntu, CentOS, SUSE, openSUSE, Fedora.

1. Grammar

dnsdomainname [-v]

2. Option list

option

description

--help

Show Help Documentation

--version

Show command version

-v

Show detailed execution process

3. Examples

Show host domain name

[root@localhost ~]# dnsdomainname -v //-v option shows detailed execution

gethostname()=`localhost.localdomain'

Resolving `localhost.localdomain' ...

Result: h_name=`localhost'

Result: h_aliases=`localhost.localdomain'

Result: h_aliases=`localhost4'

Result: h_aliases=`localhost4.localdomain4'

Result: h_aliases=`localhost.localdomain'

Result: h_aliases=`localhost6'

Result: h_aliases=`localhost6.localdomain6'

Result: h_addr_list=`127.0.0.1'

Result: h_addr_list=`127.0.0.1'

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 301

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report