dbTalk Databases Forums  

[BUGS] BUG #1088: Name resolution connecting to a database

mailing.database.pgsql-bugs mailing.database.pgsql-bugs


Discuss [BUGS] BUG #1088: Name resolution connecting to a database in the mailing.database.pgsql-bugs forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
PostgreSQL Bugs List
 
Posts: n/a

Default [BUGS] BUG #1088: Name resolution connecting to a database - 03-02-2004 , 08:18 AM







The following bug has been logged online:

Bug reference: 1088
Logged by: Antonino Albanese

Email address: al.an (AT) sitvallee (DOT) it

PostgreSQL version: 7.4

Operating system: Linux server.sitvallee.it 2.4.20-28.7smp #1 SMP Thu Dec
18 11:18:31 EST 2003 i686 unknown

Description: Name resolution connecting to a database

Details:

I'm using postgresql 7.4.1 exactly the rpm version:
nino@server:~$ rpm -qva|grep -i postgresql
postgresql-docs-7.4.1-1PGDG
postgresql-devel-7.4.1-1PGDG
postgresql-contrib-7.4.1-1PGDG
postgresql-server-7.4.1-1PGDG
postgresql-libs-7.4.1-1PGDG
postgresql-7.4.1-1PGDG
postgresql-pl-7.4.1-1PGDG

on a 7.3 RH Server:
Linux server.sitvallee.it 2.4.20-28.7smp #1 SMP Thu Dec 18 11:18:31 EST 2003
i686 unknown

all the tests where done directly on the database
server, but I've got the same behavior from different
clients, either using psql or the php interface

trying to connect to the server with domain name
takes long time, here an example:
nino@server:~$ time psql -h server -d newtestdb -U download -c '\q'

real 0m10.151s
user 0m0.010s
sys 0m0.000s

but every thing works fine if I use the IP address:
nino@server:~$ time psql -h 192.168.0.1 -d newtestdb -U download -c '\q'

real 0m0.023s
user 0m0.000s
sys 0m0.020s

here the content of my configuration files:
------------------------------------
/var/lib/pgsql/data/pg_hba.conf
------------------------------------
local all all ident sameuser
host sitvallee download 192.168.0.0 255.255.255.0 trust
host newtestdb download 192.168.0.0 255.255.255.0 trust
host all all 127.0.0.1 255.255.255.255 md5
host all all 192.168.0.0 255.255.255.0 md5

------------------------------------
/var/lib/pgsql/data/postgresql.conf
------------------------------------
tcpip_socket = true
max_connections = 100
shared_buffers = 64000
sort_mem = 8192
effective_cache_size = 8000
datestyle = 'sql, european'
LC_MESSAGES = 'C'
LC_MONETARY = 'C'
LC_NUMERIC = 'C'
LC_TIME = 'C'

------------------------------------
/etc/host.conf
------------------------------------
order hosts,bind

------------------------------------
/etc/hosts
------------------------------------
127.0.0.1 localhost local # loopback
# Local Network.
192.168.0.13 capo.sitvallee.it capo
192.168.0.14 laptop.sitvallee.it laptop
192.168.0.10 devwin.sitvallee.it devwin
192.168.0.12 devgis.sitvallee.it devgis
192.168.0.11 devweb.sitvallee.it devweb
192.168.0.230 printer.sitvallee.it printer
192.168.0.1 server.sitvallee.it server
192.168.0.2 gateway.sitvallee.it gateway
192.168.0.5 switch.sitvallee.it switch

Hope I gave every needed information

Sincerely
Nino


---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo (AT) postgresql (DOT) org

Reply With Quote
  #2  
Old   
Tom Lane
 
Posts: n/a

Default Re: [BUGS] BUG #1088: Name resolution connecting to a database - 03-02-2004 , 09:31 AM






"PostgreSQL Bugs List" <pgsql-bugs (AT) postgresql (DOT) org> writes:
Quote:
trying to connect to the server with domain name
takes long time, here an example:
...
but every thing works fine if I use the IP address:
There's something wrong with your DNS setup. You'll probably find that
the same delay occurs with any program that tries to resolve a host name
(if in doubt, try "nslookup server").

I'd bet that your /etc/resolv.conf is pointing at a dead nameserver.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings


Reply With Quote
  #3  
Old   
Richard Huxton
 
Posts: n/a

Default Re: [BUGS] BUG #1088: Name resolution connecting to a database - 03-02-2004 , 09:41 AM



On Tuesday 02 March 2004 14:09, PostgreSQL Bugs List wrote:
Quote:
The following bug has been logged online:

Bug reference: 1088
Logged by: Antonino Albanese
Email address: al.an (AT) sitvallee (DOT) it

Description: Name resolution connecting to a database

trying to connect to the server with domain name
takes long time, here an example:
nino@server:~$ time psql -h server -d newtestdb -U download -c '\q'

real 0m10.151s
user 0m0.010s
sys 0m0.000s
This looks like a problem in your DNS setup rather than PostgreSQL - the 10
minutes is a timeout. Possibly with reverse lookup. You may see similar
problems with a mailserver if you are running one (and mailserver lists are a
good place to search too).

You may want to investigate /etc/resolv.conf on both machines as well as the
dig/host commands. Don't forget it could be a problem with server A lookup up
server B or vice versa.

HTH
--
Richard Huxton
Archonet Ltd

---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.