+ Reply to Thread
Results 1 to 8 of 8

Thread: adding static host to /etc/hosts

  1. #1
    peterh14 is offline Junior Member
    Join Date
    May 12th, 2008
    Posts
    4
    Downloads
    0
    Uploads
    0

    Default adding static host to /etc/hosts

    Hello,

    I've checked man pages and documentation and I've not been able to find an answer for this:

    How do I add a line to genconfig's /etc/hosts? I need to specify the short and long names as well as the IP address of my license server.

    Peter

  2. #2
    ltsai is offline Project Moderator
    Join Date
    March 4th, 2008
    Posts
    61
    Blog Entries
    3
    Downloads
    3
    Uploads
    0

    Default

    Peter,

    You can use addhost to add an unmanaged host:

    Code:
    [root@master genconfig]# addhost -x 192.168.1.100 -s example.com
    Shutting down dhcpd:                                       [  OK  ]
    Starting dhcpd:                                            [  OK  ]
    Running plugin:  /opt/kusu/lib/plugins/cfmsync/getent-data.sh
    Distributing 9 KBytes to all nodes.
    Updating installer(s)
    Sending to 172.20.255.255
    Sending to 172.20.255.255
    Sending to 172.20.255.255
    Sending to 172.20.255.255
    Sending to 172.20.255.255
    [root@master genconfig]# cat /etc/hosts
    #
    # Dynamically generated by: genconfig  (Do not edit!)
    #
    127.0.0.1       localhost.localdomain   localhost
    10.10.9.60      master.example.com      master-eth1.kusu        master-eth1     master
    172.20.0.1      master.kusu     master-eth0.kusu        master-eth0
    172.20.0.2      compute-123-00.kusu     compute-123-00-eth0.kusu        compute-123-00-eth0     compute-123-00
    172.20.0.3      compute-123-01.kusu     compute-123-01-eth0.kusu        compute-123-01-eth0     compute-123-01
    
    # Unmanaged Nodes
    192.168.1.100   example.com.kusu        example.com
    
    -Liming

  3. #3
    peterh14 is offline Junior Member
    Join Date
    May 12th, 2008
    Posts
    4
    Downloads
    0
    Uploads
    0

    Default

    Thanks!

    Peter

  4. #4
    Henk Meij is offline Junior Member
    Join Date
    April 7th, 2009
    Posts
    18
    Downloads
    4
    Uploads
    0

    Default adding external host, not a node

    During boot, NFS mounts fail from our NAS appliance with host can not be found. I can bypass that by mounting later via /etc/rc.local on head node.

    I tried adding the NAS host with -x but this implies adding an unmanaged node.

    Is there a way to just add an external host entry?

    -Henk

  5. #5
    ltsai is offline Project Moderator
    Join Date
    March 4th, 2008
    Posts
    61
    Blog Entries
    3
    Downloads
    3
    Uploads
    0

    Default

    Hi

    An unmanaged node for is simply a node that is not managed by Kusu. It can be a switch or a NAS appliance, in your case.

    Is the NAS appliance hostname resolvable in your lan DNS? Can you provide the output of /etc/resolv.conf and /etc/named.conf.

    -Limng

  6. #6
    Henk Meij is offline Junior Member
    Join Date
    April 7th, 2009
    Posts
    18
    Downloads
    4
    Uploads
    0

    Default contents of files

    These files are looking good. Again, once the head node boots, mount -a has no problem. I think it has to do with the timing of when NFS mounts are done in the boot sequence. I could reorder that but the save bet is to just add that mount command in /etc/rc.local

    -Henk

    # Dynamically generated by: genconfig (Do not edit!)
    # Type = master

    search ocs5 wesleyan.edu

    # Local DNS enabled.
    nameserver 127.0.0.1

    //
    // Dynamically generated by: genconfig (Do not edit!)
    //
    options {
    directory "/var/named";
    dump-file "/var/named/data/cache_dump.db";
    statistics-file "/var/named/data/named_stats.txt";
    forwarders { 129.133.6.10;129.133.6.11; };
    };


    //
    // a caching only nameserver config
    //
    controls {
    inet 127.0.0.1 allow { localhost; } keys { rndckey; };
    };

    zone "." IN {
    type hint;
    file "named.ca";
    };

    zone "localdomain" IN {
    type master;
    file "localdomain.zone";
    allow-update { none; };
    };

    zone "localhost" IN {
    type master;
    file "localhost.zone";
    allow-update { none; };
    };

    zone "0.0.127.in-addr.arpa" IN {
    type master;
    file "named.local";
    allow-update { none; };
    };

    zone "0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0 .0.0.0.0.0.0.ip6.arpa" IN {
    type master;
    file "named.ip6.local";
    allow-update { none; };
    };

    zone "255.in-addr.arpa" IN {
    type master;
    file "named.broadcast";
    allow-update { none; };
    };

    zone "0.in-addr.arpa" IN {
    type master;
    file "named.zero";
    allow-update { none; };
    };

    zone "ocs5" IN {
    type master;
    file "ocs5.zone";
    notify yes;
    allow-update { none; };
    };

    zone "2.168.192.in-addr.arpa" in {
    type master;
    file "192.168.2.0.rev";
    notify yes;
    allow-update { none; };
    };

    zone "1.3.10.in-addr.arpa" in {
    type master;
    file "10.3.1.0.rev";
    notify yes;
    allow-update { none; };
    };

    zone "1.133.129.in-addr.arpa" in {
    type master;
    file "129.133.1.0.rev";
    notify yes;
    allow-update { none; };
    };

    zone "1.168.192.in-addr.arpa" in {
    type master;
    file "192.168.1.0.rev";
    notify yes;
    allow-update { none; };
    };

  7. #7
    ltsai is offline Project Moderator
    Join Date
    March 4th, 2008
    Posts
    61
    Blog Entries
    3
    Downloads
    3
    Uploads
    0

    Default

    Can you also provide the original fstab before the mount entry has been moved to rc.local?

    -Liming

  8. #8
    Henk Meij is offline Junior Member
    Join Date
    April 7th, 2009
    Posts
    18
    Downloads
    4
    Uploads
    0

    Default

    LABEL=/ / ext3 defaults 1 1
    LABEL=/data /data ext3 defaults 1 2
    LABEL=/var /var ext3 defaults 1 2
    LABEL=/boot /boot ext3 defaults 1 2
    tmpfs /dev/shm tmpfs defaults 0 0
    devpts /dev/pts devpts gid=5,mode=620 0 0
    sysfs /sys sysfs defaults 0 0
    proc /proc proc defaults 0 0
    LABEL=SWAP-sda5 swap swap defaults 0 0
    192.168.1.217:/home /home nfs defaults 0 0

+ Reply to Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts