Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.1k views
in Technique[技术] by (71.8m points)

flutter - How to resolve - SocketException: Failed host lookup: 'server.com' (OS Error: nodename nor servname provided, or not known, errno = 8)

I am pretty new to flutter development. I am getting the following error on connecting to the server:

SocketException: Failed host lookup: 'server.com' (OS Error: nodename nor servname provided, or not known, errno = 8)

I already referred the below link, but this was of no help for me

How to solve SocketException: Failed host lookup: 'www.xyz.com' (OS Error: No address associated with hostname, errno = 7)

Currently I am testing my application on iOS simulator. Below are the versions I am using,

  • Http version - http: ^0.12.2
  • Flutter version - 1.22.4(Stable version)

The server is connecting when I am using mobile hotspot with my company's VPN enabled. But, I get this error when I switch to the company LAN.

All the APIs are working fine in postman when connected to LAN. I am using Android Studio. Is there any specific configuration to be made in flutter? Please let me know...

question from:https://stackoverflow.com/questions/65896107/how-to-resolve-socketexception-failed-host-lookup-server-com-os-error-no

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...