Quantcast
Channel: Getting 127.0.1.1 instead of 192.168.1.* ip ubuntu python - Stack Overflow
Browsing latest articles
Browse All 7 View Live

Answer by Bruce for Getting 127.0.1.1 instead of 192.168.1.* ip ubuntu python

This also worked for me:gethostbyname(gethostname()+'.')

View Article



Answer by Marimuthu for Getting 127.0.1.1 instead of 192.168.1.* ip ubuntu...

i get the same problem what your are facing. but I get the solution with help of my own idea, And don't worry it is simple to use.if you familiar to linux you should heard the ifconfig command which...

View Article

Answer by JubinBlack for Getting 127.0.1.1 instead of 192.168.1.* ip ubuntu...

I got this same problem with my raspi.host_name = socket.gethostname()`host_addr = socket.gethostbyname(host_name)and now if i print host_addr, it will print 127.0.1.1.So i foundthis:...

View Article

Answer by sanooj for Getting 127.0.1.1 instead of 192.168.1.* ip ubuntu python

As per the above '/etc/hosts' file content, you have an IP address mapping with '127.0.1.1' to your hostname. This is causing the name resolution to get 127.0.1.1. You can try removing/commenting this...

View Article

Answer by Patrik for Getting 127.0.1.1 instead of 192.168.1.* ip ubuntu python

How can I get the IP address of eth0 in Python?s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)s.connect(("8.8.8.8", 80))print s.getsockname()[0]

View Article


Answer by Remy for Getting 127.0.1.1 instead of 192.168.1.* ip ubuntu python

This solution works for me on Windows. If you're using Linux you could try this line of code instead:IPAddr = socket.gethostbyname(socket.getfqdn())

View Article

Getting 127.0.1.1 instead of 192.168.1.* ip ubuntu python

I am new to python. I want to get the ipaddress of the system. I am connected in LAN. When i use the below code to get the ip, it shows 127.0.1.1 instead of 192.168.1.32. Why it is not showing the LAN...

View Article
Browsing latest articles
Browse All 7 View Live


Latest Images