Bug #4229 MySQL does not resolve DNS server name
Submitted: 21 Jun 2004 10:55 Modified: 23 Jun 2004 20:37
Reporter: Minh Tran Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server: Command-line Clients Severity:S2 (Serious)
Version:4.0.20 OS:Linux (Linux)
Assigned to: Matthew Lord CPU Architecture:Any

[21 Jun 2004 10:55] Minh Tran
Description:
Hello,

Since upgrading from version 4.0.18 to 4.0.20-icc, I have not been able to connect to my MySQL server using the server's DNS name.  However, I have been able to connect to the same server using its IP address.

When I tried using the mysql client program from the 4.0.18 distribution on the same server, I am then able to connect to the MySQl 4.0.20 server using both its IP and DNS name.

The server I am using is a primary DNS.  It runs MySQL 4.0.20-icc with Apache / PHP, pretty much like a LAMP configuration.

Hope this helps.

Minh Tran

How to repeat:
mysql -h <server name>, e.g. mysql -h db.mydomain.com
  This does *NOT* work

mysql -h 192.168.1.1
  This *DOES* work
[23 Jun 2004 3:07] Matthew Lord
Hi, 

I'm having problems repeating the problem.  Are you specifying a value for thread_stack in any of your 
.cnf files?

Best Regards
[23 Jun 2004 10:33] Minh Tran
The my.cnf file I use is as follows:

# MySQL configuration file for a large system.
#

# The following options will be passed to all MySQL clients.
[client]
port                    = 3306
socket                  = /tmp/mysql.sock

# The following options will be passed to specific programs.

# The ISAM check and repair tool
[isamchk]
key_buffer              = 64M
read_buffer             = 2M
sort_buffer             = 64M
write_buffer            = 2M

# The MyISAM check and repair tool
[myisamchk]
key_buffer              = 64M
read_buffer             = 2M
sort_buffer             = 64M
write_buffer            = 2M

# The MySQL client
[mysql]
no-auto-rehash

# The MySQL server
[mysqld]
skip-external-locking
skip-host-cache
skip-locking
skip-name-resolve
back_log                = 768
basedir                 = /opt/mysql/
connect_timeout         = 30
datadir                 = /var/lib/mysql/
key_buffer              = 384M
interactive_timeout     = 3600
long_query_time         = 15
max_allowed_packet      = 2M
max_connect_errors      = 1024
max_connections         = 1536
max_delayed_threads     = 32
max_tmp_tables          = 32
open_files_limit        = 8192
pid-file                = /var/run/mysqld/mysqld.pid
port                    = 3306
query_cache_limit       = 512K
query_cache_size        = 64M
query_cache_type        = 1
read_buffer_size        = 4M
socket                  = /tmp/mysql.sock
sort_buffer_size        = 4M
table_cache             = 1024
thread_cache_size       = 512
thread_concurrency      = 8
wait_timeout            = 180

# The MySQL dumping / backing up client
[mysqldump]
quick
add-drop-table          = 1
max_allowed_packet      = 16M

[mysqlhotcopy]
interactive-timeout
[23 Jun 2004 20:37] Matthew Lord
You are using the skip-name-resolve option which tells mysql not to resolve host names.