• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

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

LEGEND ,
Aug 06, 2017 Aug 06, 2017

Copy link to clipboard

Copied

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.

TOPICS
Database access

Views

2.3K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Aug 07, 2017 Aug 07, 2017

Copy link to clipboard

Copied

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,

^ _ ^

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Aug 11, 2017 Aug 11, 2017

Copy link to clipboard

Copied

Is anyone perusing the Database Access forum???

V/r,

^ _ ^

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Aug 16, 2017 Aug 16, 2017

Copy link to clipboard

Copied

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

Cheers

Eddie

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Aug 16, 2017 Aug 16, 2017

Copy link to clipboard

Copied

Hi, Eddie.

Yes, the DSN in CFAdmin does still work.

V/r,

^ _ ^

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Aug 16, 2017 Aug 16, 2017

Copy link to clipboard

Copied

Is the IP address that MySQL doesn't like, the address of the ColdFusion server?

Cheers

Eddie

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Aug 16, 2017 Aug 16, 2017

Copy link to clipboard

Copied

Yes.

Which is odd.  It works to load the images of the public home page, and it works to get the credentials of whichever admin is logging on to the CMS; but when it loads the CMS home page, that's when it says "Hey, I can't resolve this IP address."

????

V/r,

^ _ ^

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Aug 16, 2017 Aug 16, 2017

Copy link to clipboard

Copied

Do you have the DSN configured to keep the database connection open or does it create a new connection for every query?

Cheers

Eddie

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Aug 16, 2017 Aug 16, 2017

Copy link to clipboard

Copied

Aaaaaaaaaaaaaaaaaaaaaaaaaaaaah...  that's a good question.  I'm at work, right now, and my virtual dev network is at home.  I'll check (when I have the time) and get back to you on that.

I suspect, though, that it's set for keeping connections, as I believe that is the default.  And that sounds like something I would set, even if it isn't default.

Thanks for the question, though!  Now I can't wait to get home and see. 

V/r,

^ _ ^

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Aug 16, 2017 Aug 16, 2017

Copy link to clipboard

Copied

Just covering all the bases.

The MySQL error message is odd. Normally host names are resolved to IP addresses. I wonder why MySQL is trying to "resolve" an IP address. It may have something to do with MySQL security, which can be configured per IP address or host name. It would be worth checking the MySQL security for the user you are using in your ColdFusion DSN. Is it using an IP address wildcard or a host name?

Cheers

Eddie

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Aug 16, 2017 Aug 16, 2017

Copy link to clipboard

Copied

Eddie,

I just checked the DSN, and both DSNs for my project (one user, one admin) are set to maintain connections across client requests.

That's what makes this even more confusing.  Why would a system need to resolve an IP address?  IDK.

Honestly, this is my first foray into the dark world of LINUX!  (Dun, dun, dunnnnnnnn!)  So, I don't know how to check MySQL security, much less what user account is being used for CF.  (Hangs head in semi-shame.)

No wildcards.  I've got virtual host going, so my project is "dev.domainname.com" and I've set up all my testing system "host" files to reflect that FQDN towards the web server IP.

It's been working flawlessly for two years.  I suspect that a sudo aptitude upgrade/update may have changed something, but can't figure out what.

V/r,

^ _ ^

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Aug 17, 2017 Aug 17, 2017

Copy link to clipboard

Copied

WolfShade  wrote

I don't know how to check MySQL security, much less what user account is being used for CF.

If you look at the DSN details in ColdFusion Admin, you will see the MySQL user account being used. How did you create the account in MySQL that you are using in the ColdFusion DSN?

Cheers

Eddie

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Aug 17, 2017 Aug 17, 2017

Copy link to clipboard

Copied

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,

^ _ ^

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Aug 17, 2017 Aug 17, 2017

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Aug 17, 2017 Aug 17, 2017

Copy link to clipboard

Copied

I've got a Windows VM that has MySQL Workbench on it (as well as SQL Server Express, for other jobs) but I don't know how to set it up for actually configuring anything.. I've been relying on Google to provide CLI instructions for that.  Apparently, not very well.

V/r,

^ _ ^

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 21, 2017 Aug 21, 2017

Copy link to clipboard

Copied

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?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Aug 22, 2017 Aug 22, 2017

Copy link to clipboard

Copied

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,

^ _ ^

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 23, 2017 Aug 23, 2017

Copy link to clipboard

Copied

LATEST

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation