Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
/etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost.localdomain localhost
::1 localhost6.localdomain6 localhost6
192.168.2.201 black.testrac.com black
Note that it is a static IP address.
ping black
PING black.testrac.com (192.168.2.201) 56(84) bytes of data.
64 bytes from black.testrac.com (192.168.2.201): icmp_seq=1 ttl=64 time=0.048 ms
[root@black ~]# ping black.testrac.com
PING black.testrac.com (192.168.2.201) 56(84) bytes of data.
64 bytes from black.testrac.com (192.168.2.201): icmp_seq=1 ttl=64 time=0.054 ms
route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.2.0 * 255.255.255.0 U 0 0 0 eth1
192.168.2.0 * 255.255.255.0 U 0 0 0 eth0
192.168.122.0 * 255.255.255.0 U 0 0 0 virbr0
169.254.0.0 * 255.255.0.0 U 0 0 0 eth0
default . 0.0.0.0 UG 0 0 0 eth1
hostname
black.testrac.com
hostname --fqdn
black.testrac.com
dnsdomainname
testrac.com
domainname
(none)
What is the secret to getting a fully qualified domain name, such that the command, domainname will work?
domainname - show or set the system's NIS/YP domain name
So the first question is: do you have a NIS/YP server running? If not, then there's no real use for this I think. You can set your FQDN to whatever you want since you'll be working only locally and in your resolv.conf you're pointing first to files, so if you configured it in your hosts file, it should work. In my opinion this has nothing to do with the domainname command not resolving. If you really need it, you can set it with the domainname command (man page).
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.