Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
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.
Hello,
I had recently migrated my servers between two domains: biz-old.com -> biz-new.net
/etc/hostname contains pute host name, i.e. "my-host" without the domain.
I checked {yp,nis,}domainname and none is set, but "hostname -A" still shows the biz-old.com domain.
What do I need to do, so "hostname -A" shows "my-host.biz-new.net" instead of "my-host.biz-old.com ?
Forgot the distribution name:
Code:
# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 7.6 (Maipo)
What do I need to do, so "hostname -A" shows "my-host.biz-new.net" instead of "my-host.biz-old.com ?
Code:
man hostname
and read about what -A actually does and read the section on THE FQDN You may have to change a number of things in a number of places to achieve your result.
mentions something about "the resolver", "getaddrinfo" and "gethostname" which are neither any commands or have manual entres.
It also mentions to add the domain into /etc/hostname. Well, tried that and
Code:
hostname -A
ignores that file showing the old domain.
I guess the key is to translate a sentence: "enumerates all configured network addresses on all configured network interfaces, and translates them to DNS domain names" into an actionable set of commands.
Can anyone of you, black-screen gurus, help me with that?
mentions something about "the resolver", "getaddrinfo" and "gethostname" which are neither any commands or have manual entres.
It also mentions to add the domain into /etc/hostname. Well, tried that and
Code:
hostname -A
ignores that file showing the old domain.
I guess the key is to translate a sentence: "enumerates all configured network addresses on all configured network interfaces, and translates them to DNS domain names" into an actionable set of commands.
Can anyone of you, black-screen gurus, help me with that?
From man hostname:
Quote:
-A, --all-fqdns
Displays all FQDNs of the machine. This option enumerates all configured network addresses on all configured network interfaces, and translates them to DNS domain names. Addresses that cannot be translated (i.e.
because they do not have an appropriate reverse DNS entry) are skipped. Note that different addresses may resolve to the same name, therefore the output may contain duplicate entries. Do not make any assumptions about
the order of the output.
On my server, there are around 300 FQDNs - only one show up using hostname -A, because there's only one rDNS set up.
Indeed a network must be involved in my situation as I cannot find anything locally that would mention the old domain.
Unfortunately, I don't really know what are you talking about (I need actionable set of commands), but when I try DNS then I get the new domain (i.e. output of "host -v my-host").
If DNS gives me the new domain then, where does "hostname -A" take the old domain from?
Indeed a network must be involved in my situation as I cannot find anything locally that would mention the old domain.
Unfortunately, I don't really know what are you talking about (I need actionable set of commands), but when I try DNS then I get the new domain (i.e. output of "host -v my-host").
If DNS gives me the new domain then, where does "hostname -A" take the old domain from?
See #5:
Quote:
This option enumerates all configured network addresses on all configured network interfaces, and translates them to DNS domain names
so the A option takes the IP addresses, looks up the rDNS for each and reports the host name, if it finds an rDNS (reverse DNS).
What does
Strange output.
Did you munge the IP address? That return is giving a sub-domain of ###.com, formerly known as CSC.
That IP gives me a sub-domain of ###.com, also associated with DXC
(HP consulting merged with CSC. DXC is the resulting company)
Is grens0.### or plsekatlastst01.### the "old" hostname?
Do you work for DXC? If so, I'd recommend you talk to your IT department. What you're doing could be career-limiting. (This from a retired CSC techie)
Career-limiting might be that I posted real IP and names. It is worrying that you could get the server name from it while it is supposed to be internal and the IP NATted.
I'll wipe out my previous post... Can you also edit yours, please?
Yes, plsek.... is the old hostname and old domain names. I can only guess, that as the DNS contains two entries for the old and new domains then "hostname -A" just picks the first DNS entry which by coincidence is the old domain.
Career-limiting might be that I posted real IP and names. It is worrying that you could get the server name from it while it is supposed to be internal and the IP NATted.
I'll wipe out my previous post... Can you also edit yours, please?
Yes, plsek.... is the old hostname and old domain names. I can only guess, that as the DNS contains two entries for the old and new domains then "hostname -A" just picks the first DNS entry which by coincidence is the old domain.
Edit done.
The man page notes that if there are multiple domain names for an IP address, hostname -A should report all of them.
That the IP resolves publicly simply means that it's defined in a public name server, not necessarily that it is accessible by the public...but yes, you should probably escalate the problem.
I presume the domain name is taken from the public DNS.
When on my home network (= using my ISP dns servers) then my server's IP resolves to the old domain name (as found by @scasey).
When on the corporate network then "nslookup" or "dig -x" returns the error ("Got bad packet: bad label type" mentioned above). Surprisingly (at least to me), the corporate DNS works OK with old and new domains resolving to the proper IP when pinging or telneting.
Maybe because of the error in the internal DNS a public DNS is queried?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.