Skip to content

Instantly share code, notes, and snippets.

@hgfischer
Created March 24, 2011 13:47
Show Gist options
  • Save hgfischer/885080 to your computer and use it in GitHub Desktop.
Save hgfischer/885080 to your computer and use it in GitHub Desktop.
RedHat/CentOS MDNS settings
# adjust /etc/sysconfig/network with your hostname without domain
# add [hostname].local in /etc/hosts
# 127.0.0.1 [hostname].local [hostname] >> /etc/hosts
echo 'send host-name "<hostname>";' > /etc/dhclient-eth0.conf
echo 'supersede domain-name "local";' >> /etc/dhclient-eth0.conf
echo 'supersede domain-search "local";' >> /etc/dhclient-eth0.conf
yum install nss-mdns -y
service network restart
@zaypen
Copy link

zaypen commented Jan 22, 2015

cat /etc/sysconfig/network | grep -v HOSTNAME= >/etc/sysconfig/network
echo 'HOSTNAME='$(hostname) >>/etc/sysconfig/network
echo '127.0.0.1' $(hostname)'.local' $(hostname) >>/etc/hosts
echo 'send host-name "'$(hostname)'";' > /etc/dhclient-eth0.conf
echo 'supersede domain-name "local";' >> /etc/dhclient-eth0.conf
echo 'supersede domain-search "local";' >> /etc/dhclient-eth0.conf
yum install nss-mdns -y
service network restart

Good job! And I think this would be better : )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment