Skip to main content
WolfShade
Legend
August 6, 2017
Question

IP address 'x.x.2.161' could not be resolved: Name or service not known

  • August 6, 2017
  • 2 replies
  • 2879 views

Hello, all,

I've got a virtual network running in VMware Workstation 11 that has two Ubuntu Servers (Trusty Tahr, CLI only) and a Windows 7 client (need the GUI for Workbench.)  It has been running smoothly for over two years.  Until yesterday.

I started up my clients, opened a browser to go to the DEV environment, and the site came up fine.  Then I tried to log on to my site.  Error.  Checking the resulting email, it said something about trying to connect three times to the database and giving up.

So I checked various logs and came across this in /var/log/mysql/error.log:

IP address 'x.x.2.161' could not be resolved: Name or service not known

This was never a problem in the last two years.  Why now?  And how can the system NOT resolve AN IP ADDRESS????

Please advise.

V/r,

^ _ ^

PS ColdFusion 11 running on Ubuntu 14.04.5 LTS on one client; MySQL 5.6.33-0ubuntu0.14.04.1 on another client.

This topic has been closed for replies.

2 replies

BKBK
Community Expert
Community Expert
August 21, 2017

WolfShade  wrote

I started up my clients, opened a browser to go to the DEV environment, and the site came up fine.  Then I tried to log on to my site.  Error.  Checking the resulting email, it said something about trying to connect three times to the database and giving up.

So I checked various logs and came across this in /var/log/mysql/error.log:

IP address 'x.x.2.161' could not be resolved: Name or service not known

This was never a problem in the last two years.  Why now?  And how can the system NOT resolve AN IP ADDRESS????

Could it be a settings problem related to name lookup and resolution in MySQL?

WolfShade
WolfShadeAuthor
Legend
August 22, 2017

It could be, but I don't know how to bind my MySQL servers to my network.  And I'm not sure about the other solution for the my.cnf file.  Is that safe??

V/r,

^ _ ^

BKBK
Community Expert
Community Expert
August 23, 2017

WolfShade  wrote

Is that safe??

In your development environment: more or less. But it might be inconvenient. If you use the skip_name_resolve flag, MySQL will only accept usernames containing an IP. That is, usernames of the form myUsername@IPAddress. To be on the safe side, you will then have to re-create all user accounts so that they conform to this form.

We're of course making an assumption about the root cause.

This was never a problem in the last two years.  Why now?  And how can the system NOT resolve AN IP ADDRESS????

Assumption: MySQL encountered a user, WolfShade@123.123.2.161, but was unable to resolve 123.123.2.161 to a host name. If so, then another possible solution would be to:

Open MySQL Workbench;

Go to Security => Users and Privileges;

Create the following 2 accounts:

    Login Name: WolfShade

    Limit Connectivity to Hosts Matching: 123.123.2.161

    Login Name: WolfShade

    Limit Connectivity to Hosts Matching: host_name

WolfShade
WolfShadeAuthor
Legend
August 7, 2017

The perplexing thing about this is that the database seems to work fine when the site is first opened.  It gets images for a slideshow, and text for the news section.  And, apparently, the login process itself works.  The error happens after the login process is completed, and the query that causes the error is the query that gets the images for the slideshow.

V/r,

^ _ ^

EddieLotter
Inspiring
August 16, 2017

After the database connection error occurs, log into CF Admin and test the DSN. Does it work from CF Admin?

Cheers

Eddie

EddieLotter
Inspiring
August 17, 2017

I hate to say it, but that was two years ago.  I'm sure I Googled it, and followed the instructions.  Didn't bookmark it (like I _should_ have), or print out the instructions (like I _should_ have), and don't remember (I'm getting old.) 

V/r,

^ _ ^


WolfShade  wrote

(I'm getting old.) 

I know that feeling!

Search for MySQL Workbench or the equivalent for LINUX. It will allow you to configure your MySQL settings.

Cheers

Eddie