NoOps

Ops make no ops | Ops的目标是没有Ops,嗯!

a ubuntu dns problem

作者: |   505 浏览  | 

a workmate told us his PC can’t connect to a url successfully.his OS version is ubuntu 12.04

firstly we SA use dig\nslookup to find if there is any problem with our dns service on his pc.we find website like baidu.com and 163.com always have right reslove,but don’t have inverse reslove.even though our dns service always response right/inverse reslove quickly.

but when we use ping,the ping program always very slow,and the ttl is as small as usual.so we use “strace ping www.baidu.com” to fix this problem.

finally,we find there is a socket named avahi used by ping do not response the query to get the inverse reslove of the ip addr of www.baidu.com.

we find the resolve steps of ping program when we fix this problem:

1.ping get the right resolve ip addr of www.baidu.com by our dns server

2.ping get the inverse resolve hostname of ip addr(www.baidu.com)  by our dns server

3.ping can’t get a inverse resolve hostname by our dns server,then query pc’s /etc/hosts

4.ping can’t get a inverse resolve hostname by the host’s /etc/hosts,query the socket avahi

5.avahi-daemon did not response the query,and also waster 3-4 seconds

finally,we use command #service avahi-daemon stop to stop the avahi service,and then the program fixed.

we also found more then 2 PCs use ubuntu system have this problem.

what is avahi

Avahi allows programs to publish and discover services and hosts running on a local network

with no specific configuration. For example, a user can plug their computer into a network and

Avahi automatically finds printers to print to, files to look at and people to talk to, as well as

advertising the network services running on the machine.

The avahi-daemon Linux service runs on client machines to perform network-basedZeroconf service discovery. Avahi is an implementation of the DNS Service Discovery and Multicast DNS specifications for Zeroconf Networking. User applications receive notice of discovered network services and resources using the Linux D-Bus message passing. The daemon coordinates application efforts in caching replies, helping minimize network traffic.

Avahi provides a set of language bindings, including Python and Mono. Because of its modularized architecture, Avahi is already integrated in major desktop components like GNOME’s Virtual File System or KDE’s input/output architecture.

Refer http://avahi.org/ for further specifications.

The avahi RPM package provides the /usr/sbin/avahi-daemon daemon and its configuration files.

One Comment

  1. wilbur
    2013/03/24 at 10:39 上午

    troubleshooting this problem with strace

发表评论