I am trying to use socket.gethostbyname(socket.gethostname())... It is returning an ip similar to 0.0.13.29 -> I should be getting 192.168.50.194
Alternatives I have tried include using socket.gethostbyname(socket.getfqdn())
In fairness socket.gethostname() is working correctly
It is also worthwhile to mention that should I bind a socket .getsockname() returns the same ip as above.
saudrehman00 commentedDec 8, 2022
Bug report
A clear and concise description of what the bug is.
Include a minimal, reproducible example (https://stackoverflow.com/help/minimal-reproducible-example), if possible.
I am trying to use socket.gethostbyname(socket.gethostname())... It is returning an ip similar to 0.0.13.29 -> I should be getting 192.168.50.194
Alternatives I have tried include using socket.gethostbyname(socket.getfqdn())
In fairness socket.gethostname() is working correctly
It is also worthwhile to mention that should I bind a socket .getsockname() returns the same ip as above.
Your environment
Python 3.10.8 (main, Nov 14 2022, 00:00:00) [GCC 12.2.1 20220819 (Red Hat 12.2.1-2)] on linux
NAME="Fedora Linux"
VERSION="36 (Server Edition)"
ID=fedora
VERSION_ID=36
VERSION_CODENAME=""
PLATFORM_ID="platform:f36"
PRETTY_NAME="Fedora Linux 36 (Server Edition)"
ANSI_COLOR="0;38;2;60;110;180"
LOGO=fedora-logo-icon
CPE_NAME="cpe:/o:fedoraproject:fedora:36"
HOME_URL="https://fedoraproject.org/"
DOCUMENTATION_URL="https://docs.fedoraproject.org/en-US/fedora/f36/system-administrators-guide/"
SUPPORT_URL="https://ask.fedoraproject.org/"
BUG_REPORT_URL="https://bugzilla.redhat.com/"
REDHAT_BUGZILLA_PRODUCT="Fedora"
REDHAT_BUGZILLA_PRODUCT_VERSION=36
REDHAT_SUPPORT_PRODUCT="Fedora"
REDHAT_SUPPORT_PRODUCT_VERSION=36
PRIVACY_POLICY_URL="https://fedoraproject.org/wiki/Legal:PrivacyPolicy"
VARIANT="Server Edition"
VARIANT_ID=server
The text was updated successfully, but these errors were encountered: