Re: puzzling message/suggestion during weekly patches.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 2022-08-11 at 21:42 -0600, home user wrote:
> I installed sendmail-doc and read the "WHO AM I" section of README.cf.
> It says gethostname is called to get the host name, then the result of 
> that is sent to "gethostbyname" to get the fully qualified domain name. 
>   My C/C++ skills are very rusty and out-of-date, but I succeeded in 
> writing a C++ program to see what's going on.  It took a while!  The 
> hostname returned by gethostname is correct.  But the h_name returned by 
> gethostbyname is the same as what was returned by gethostname.  It was 
> not a fully qualified domain name.
> 
> I'm no sys.admin.  I do not understand what the "WHO AM I" section of 
> README.cf is saying to do in this situation.  HELP!
> 
> By the way, I was able to use mailx to send a test message from me (a 
> regular user) to root, and root received the message properly.  Also, I 
> only use mailx for messages from rkhunter and gsmartcontrol.

If you're only using mail internally, and messages are coming through,
it probably doesn't matter about the warning.  And I thought the
defaults for sendmail only worked with localhost, anyway (requiring you
to intervene with manual configuration to be less secure).

If you want to send mail to the outside world through it, you'd need to
configure everything correctly.

My previous experiments with sendmail and its documentation determined
that it *discovers* its addressing.  It knows its IP, it does a reverse
DNS query to find the hostname for that IP, and it confirms back in the
other direction (asks what IP belongs to that hostname).  It wants the
same answer in both directions.

i.e.  If it were on 192.168.1.1 and does a reverse search to find its
hostname (example.com), doing a forward search for the IP for
example.com needs to return the same 192.168.1.1 IP address.

It doesn't have to query a DNS server for that, it can use the info in
your /etc/hosts file.

Again, if you're only doing internal mail, just ensure that you have
the minimum of this in /etc/hosts:

127.0.0.1   localhost localhost.localdomain
::1         localhost localhost.localdomain

Don't put actual hostnames in with those loopback addresses.  If you do
want hostnames in /etc/hosts file (e.g. for local machines), they
should be separate, like this:

192.168.1.1  example.com  example

The actual interface IP address, then the desired full address for that
interface, and then any aliases you want to use can be listed after.

When something consults the /etc/hosts file to find the name for the
IP, the first name is returned.  Whem something consults the /etc/hosts
file to find the IP for a hostname, any name right of the IP matches.

If your server is DHCP managed, set the DHCP server to always give it
the same addresses.

-- 
 
uname -rsvp
Linux 3.10.0-1160.71.1.el7.x86_64 #1 SMP Tue Jun 28 15:37:28 UTC 2022 x86_64
 
Boilerplate:  All unexpected mail to my mailbox is automatically deleted.
I will only get to see the messages that are posted to the mailing list.
 
_______________________________________________
users mailing list -- users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to users-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/users@xxxxxxxxxxxxxxxxxxxxxxx
Do not reply to spam, report it: https://pagure.io/fedora-infrastructure/new_issue



[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [EPEL Devel]     [Fedora Magazine]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Desktop]     [Fedora Fonts]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Fedora Sparc]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux