How can I enable CentOS to find, not just broadcast, "local" domain?

Issues related to software problems.
myudkowsky2
Posts: 14
Joined: 2012/02/15 16:41:40
Contact:

How can I enable CentOS to find, not just broadcast, "local" domain?

Post by myudkowsky2 » 2012/02/15 17:12:55

Question: How can I enable CentOS to find, not just broadcast, machines in the "local" domain?

Background:

On both MacOS and Debian, once I install avahi-daemon, I'm pretty much done with all configuration. All machines can ping each other using ".local" addresses.

I can't get this to work within CentOS itself. That is, let's say I have two machines, one called "nonCent" and the other called "yesCent."

From nonCent, I can successfulloy:
ping nonCent.local
ping yesCent.local
ping nonCent

I can't ping nonCent unless I specifiy the .local domain


From yesCent, I can only:
ping yesCent

I cannot ping nonCent, nonCent.local, or yesCent.local.

Both nonCent and yesCent have a nameserver in common, which is a router running the Tomato firmware. In particular,

[code]# cat /etc/resolv.conf
; generated by /sbin/dhclient-script
nameserver x.y.z.a
[/code]

I'd like suggsetions on how to fix this. Please note that avahi-daemon is up and running on the CentOS systerm

pschaff
Retired Moderator
Posts: 18276
Joined: 2006/12/13 20:15:34
Location: Tidewater, Virginia, North America
Contact:

How can I enable CentOS to find, not just broadcast, "local"

Post by pschaff » 2012/02/15 19:12:41

Hostnames are never "broadcast". They must be provided by DNS or specified in /etc/hosts.

[quote]
myudkowsky2 wrote:
...
I can't ping nonCent unless I specifiy the .local domain[/quote]
Try adding [b]append domain-search "local";[/b] to /etc/dhclient.conf

[quote]
# cat /etc/resolv.conf
; generated by /sbin/dhclient-script
nameserver x.y.z.a
[/quote]
Is [b]x.y.z.a[/b] the address of the router on the LAN or an external nameserver?

If more help is needed then please [url=http://www.centos.org/modules/newbb/viewtopic.php?topic_id=28723&forum=54]provide more information about your system[/url] by running "./getinfo.sh network" and showing us the output file.

myudkowsky2
Posts: 14
Joined: 2012/02/15 16:41:40
Contact:

Re: How can I enable CentOS to find, not just broadcast, "local" domain?

Post by myudkowsky2 » 2012/02/15 20:26:19

pschaff,

Thanks for your reply.

First, here's an additional tidbit of information:

from my yesCent system, I can in fact see the nonCent system:
[code]
# avahi-browse -D -lavt
+ eth0 IPv4 nonCent [mac address here] Workstation local
[/code]

so the problem I have -- that I can't "ping nonCent" and that I can't "ping nonCent.local" is even less understandable, because avahi-browse can find nonCent and correctly lists the domain as "local."

I'll try that new config on nonCent to append .local for the future.

To replay to your question about the obfusticated address,
[code]
# cat /etc/resolv.conf
; generated by /sbin/dhclient-script
nameserver 1xx.yy.zz.a
[/code]

1xx.yy.zz.a is the address of my router. It runs Tomato, and the router itself has the address of upstream providers. This config lets me provision my prefered namesever for all machines in the network.

Finally, the output of "getinfo network" is at [url=http://pastebin.centos.org/38389]myudkowsky config info[/url]

pschaff
Retired Moderator
Posts: 18276
Joined: 2006/12/13 20:15:34
Location: Tidewater, Virginia, North America
Contact:

Re: How can I enable CentOS to find, not just broadcast, "local" domain?

Post by pschaff » 2012/02/15 22:22:25

There's really no reason to be obfuscating non-routing [url=http://en.wikipedia.org/wiki/Private_network]private IP addresses[/url] on the LAN. Only your public IP address is sensitive information.

Your route is messed up. There is no default gateway or [url=http://en.wikipedia.org/wiki/IPv4#Link-local_addressing]link-local address[/url]. It should look something like:
[code]
# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth0
0.0.0.0 192.168.1.1 0.0.0.0 UG 0 0 0 eth0
[/code]

myudkowsky2
Posts: 14
Joined: 2012/02/15 16:41:40
Contact:

Re: How can I enable CentOS to find, not just broadcast, "local" domain?

Post by myudkowsky2 » 2012/02/15 22:29:05

Phil,

Thanks for the tip about non-routing IPs. I'll try to refrain after this series is over, but I'll keep the notation right now for consistency's sake.

In any case,

[code]
# /sbin/route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
1xx.yy.zz.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth0
0.0.0.0 1xx.yy.zz.a 0.0.0.0 UG 0 0 0 eth0
[/code]

Which appears to be what I'd expect. Is there any other data I should be looking at? Ifconfig also looked normal.

pschaff
Retired Moderator
Posts: 18276
Joined: 2006/12/13 20:15:34
Location: Tidewater, Virginia, North America
Contact:

Re: How can I enable CentOS to find, not just broadcast, "local" domain?

Post by pschaff » 2012/02/15 22:32:52

Apparently you edited something out of the script output as that looked different.

So, now I'm confused. Are all the systems on the same LAN, presumably something like 192.168.0.0/24? Can you ping by IP address rather than hostname?

By the way - for my example - to search "local" then something like:
[code]# cat /etc/resolv.conf
; generated by /sbin/dhclient-script
search local
nameserver 192.168.1.1
[/code]

myudkowsky2
Posts: 14
Joined: 2012/02/15 16:41:40
Contact:

Re: How can I enable CentOS to find, not just broadcast, "local" domain?

Post by myudkowsky2 » 2012/02/15 22:42:24

Sorry for the confusion.

All of these are on the same network and share the same gateway, and a netmask of 255.255.255.0 lets me reach all machines.
avahi-browser from CentOS finds all the services and even the "local" domain name of nonCentOS.local.

I can ping from the CentOS server to non-CentOS servers if I use the IP address, but I can't ping using "ping nonCentOS.local" or "ping nonCentOS."

pschaff
Retired Moderator
Posts: 18276
Joined: 2006/12/13 20:15:34
Location: Tidewater, Virginia, North America
Contact:

Re: How can I enable CentOS to find, not just broadcast, "local" domain?

Post by pschaff » 2012/02/16 02:15:47

Fix your DNS to use the server on the router.

myudkowsky2
Posts: 14
Joined: 2012/02/15 16:41:40
Contact:

Re: How can I enable CentOS to find, not just broadcast, "local" domain?

Post by myudkowsky2 » 2012/02/16 13:29:20

To fix resolv.conf on a permanent basis, I've modified /etc/sysconfig/network-scripts/ifcfg-eth0 to include the line
[code]
SEARCH="local"
[/code]

I then did
[code]
/etc/init.d/network restart
[/code]

to regenerate /etc/resolv.conf, which now contains "search local" and then my local router as nameserver.

Even after a separate restasrt of avahi-daemon, I still cannot ping "local" domains ("nonCent.local") or machine names ("nonCent"). I can ping/resolve the addresses of machines outside my network, as before.

Any futhert suggestions would be ver welcome.

myudkowsky2
Posts: 14
Joined: 2012/02/15 16:41:40
Contact:

Re: How can I enable CentOS to find, not just broadcast, "local" domain?

Post by myudkowsky2 » 2012/02/16 14:24:27

I've just run some further tests, and I have odd results.

A. avahi-browse on yesCent, to find itself:
[code]
# avahi-resolve -v -n yesCent.local
Server version: avahi 0.6.16; Host name: yesCent.local
yesCent.local <correct internal IP address>
[/code]

If I then try to ping,
[code]
# ping yesCent.local
ping: unknown host yesCent.local
[/code]

For the nonCent machine, I get an IPv6 address from avahi-daemon:
[code]
# avahi-resolve -v -n nonCent.local
Server version: avahi 0.6.16; Host name: yesCent.local
nonCent.local <correct IPv6 address>
[/code]

Ping to nonCent does not work, but perhaps that's because of the IPv6 address. ping's "-I" option doesn't work for me, probably because I don't know how to use it correctly, and ping6 on nonCent.local returns "unknown host." (ping6 from a third machine to nonCent does work.)

Finally, since adding search=local, I'm no longer able to "ping yesCent" from yesCent, and that used to work.

Post Reply