LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 08-06-2009, 06:27 PM   #1
lukesc
Member
 
Registered: Oct 2007
Posts: 31

Rep: Reputation: 16
hostname problem


On our network we have a primary router that connects us to the internet and an exchange server w/ a static ip address that provides DCHP for our network (it also provides a windows domain network for win boxes).

We then have a second router setup as a wireless access point (bypassing the router) and a web server connected to that with a host name of "dev.local".

Windows machines connected to the network are logged onto the windows domain through "computername.company.local" and other non-windows boxes just connect through the network using the DCHP.

When I connect to the web server through its IP Address everything loads almost instantly like it should. But when I connect to the web server using "dev.local" (http://dev.local) it takes 20-45 seconds for a page with a few images to load.

I've tried doing a traceroute and ping the server and the speed and result of doing these things are exactly the same when doing it to the ip address or hostname. Yet when I connect to the web server there is a noticeable speed difference. I can't seem to explain why connecting to dev.local is any different than connecting to the IP Address. The only difference is I'm going through the exchange server's DNS to locate dev.local. But other types of connections don't seem to be effected.

Anyone got any idea of what's causing this?
 
Old 08-06-2009, 07:12 PM   #2
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
Names that have .local at the end may be using zeroconf (avahi on linux) to resolve the address. It is notoriously slow.
Could you post your /etc/resolv.conf and /etc/nsswitch.conf files? Also post "ps -e | grep avahi".

This link might explain what is happening: http://www.mail-archive.com/debian-b...msg271167.html

Another possibility is the delay is due to nss_mdns6. This will cause long delays. You need to explicitly indicate mdns4 or mdns4_minimal (instead of mdns or mdns_minimal) in /etc/resolve.conf to avoid delays.

from http://0pointer.de/lennart/projects/nss-mdns/ :
Code:
# /etc/nsswitch.conf

passwd:         compat
group:          compat
shadow:         compat

hosts:          files mdns4_minimal [NOTFOUND=return] dns mdns4
networks:       files

protocols:      db files
services:       db files
ethers:         db files
rpc:            db files

netgroup:       nis
If the MS DNS server will serve an address for dev.local, then you could remove the mdns entries from /etc/nsswitch.conf.

For my home network, I mapped static IP address to the mac addresses (using a linksys wireless router) so the DHCP server would issue the same addresses. This allowed me to add the host names to /etc/hosts without worrying about the IP addresses changing on my. I have them configured to get their address from DHCP. This gives me the best of both worlds.

Last edited by jschiwal; 08-06-2009 at 07:15 PM.
 
Old 08-06-2009, 07:28 PM   #3
lukesc
Member
 
Registered: Oct 2007
Posts: 31

Original Poster
Rep: Reputation: 16
/etc/resolv.conf is:

Code:
; generated by /sbin/dhclient-script
search company.local
nameserver 10.1.10.254
The IP address 10.1.10.254 goes to the exchange/dchp server for the lan.

/etc/nsswitch.conf is (without comments):

Code:
passwd: files
shadow: files
group: files

hosts: files dns

bootparams: nisplus [NOTFOUND=return] files

ethers: files
netmasks: files
networks: files
protocols: files
rpc: files
services: files

netgroup: nisplus

publickey: nisplus

automount: files nisplus
aliases: files nisplus
"ps -e | grep avahi" reads:

Code:
2856 ? 00:00:00 avahi-daemon
2857 ? 00:00:00 avahi-daemon
 
Old 08-07-2009, 02:18 PM   #4
lukesc
Member
 
Registered: Oct 2007
Posts: 31

Original Poster
Rep: Reputation: 16
We have a local DNS server for the network and I just created my own local-only TLD. The new hostnames do not have the same problem.
 
Old 08-08-2009, 10:20 AM   #5
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
I don't think I paid close enough attention to
Quote:
I've tried doing a traceroute and ping the server and the speed and result of doing these things are exactly the same when doing it to the ip address or hostname.
If you run "getent hosts dev.local" and "host dev.local", is there a delay. Maybe the problem isn't in name lookup for dev.local. Could it be the other way around?

Does the server or it's firewall do reverse lookups for the logs?

Last edited by jschiwal; 08-08-2009 at 10:21 AM.
 
Old 08-11-2009, 11:28 AM   #6
lukesc
Member
 
Registered: Oct 2007
Posts: 31

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by jschiwal View Post
I don't think I paid close enough attention to

If you run "getent hosts dev.local" and "host dev.local", is there a delay. Maybe the problem isn't in name lookup for dev.local. Could it be the other way around?

Does the server or it's firewall do reverse lookups for the logs?
I don't think dev.local even works on itself. In order to get it to resolve I had to add it to /etc/hosts.

Is this the issue?
 
  


Reply



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

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



Similar Threads
Thread Thread Starter Forum Replies Last Post
after hostname change, syslogd still output previous hostname to messages file tiger2000 Linux - General 3 07-22-2009 09:36 PM
Hostname - Problem ??? aurelio26 Linux - Newbie 3 10-04-2004 12:06 AM
hostname problem jnewing Red Hat 1 06-01-2004 06:23 PM
hostname command vs. $HOSTNAME env. variable Silly22 Linux - Networking 2 03-29-2002 05:01 PM
problem with hostname jackopa Linux - General 2 11-12-2001 02:13 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 11:17 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration