Find the answer to your Linux question:
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 16
Hi, Having troubles getting centos hostname to be resolved. Server is running CentOS release 6.3 (Final) can't ping it, and when i nslookup the name, local dns server does not ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jun 2007
    Posts
    20

    issues with resolving


    Hi,

    Having troubles getting centos hostname to be resolved.

    Server is running CentOS release 6.3 (Final)

    can't ping it, and when i nslookup the name, local dns server does not see it.
    I'm having troubles with smb, it does not start for some unknown error which I don't understand what to fix as the messages from the log is not detailed on trying to start
    samba

    Code:
    service smb start
    resulting:

    Code:
    Starting SMB services:                                     [FAILED]
    also on:

    Code:
    service smb restart
    Code:
    Shutting down SMB services:                                [FAILED]
    Starting SMB services:                                     [FAILED]
    message from log:

    Code:
    Nov  7 14:44:04 dataprobe-1 smbd[14186]: [2012/11/07 14:44:04.476049,  0] smbd/server.c:1156(main)
    Nov  7 14:44:04 dataprobe-1 smbd[14186]:   error opening config file
    smb.conf file has the following lines:

    Code:
       workgroup = DOMAIN
       password server = dcontroller.domain.com
       realm = DOMAIN.COM
       security = ads
       idmap uid = 10000-20000
       idmap gid = 10000-20000
       template homedir = /home/%D/%U
       template shell = /bin/bash
    #   winbind use default domain = true
       winbind offline logon = false
    
    #--authconfig--end-line--
    ;   workgroup = DOMAIN
    ;   realm = DOMAIN.COM
    #   server string =
    ;   use kerberos keytab = yes
    ;   kerberos method = system keytab
       kerberos method = secrets and keytab
       enable privileges = yes
       printcap name = cups
       load printers = yes
       printing = cups
       log file = /var/log/samba/log.%m
       max log size = 50
       log level = 5
       interfaces = bond0 lo
       bind interfaces only = yes
    ;  hosts allow = 192.168.1. 192.168.2. 127.
       map to guest = bad user
    ;   security = ads
       auth methods = winbind
       encrypt passwords = yes
    ;  winbind separator = +
       winbind use default domain = yes
    ;   template homedir = /home/%D/%U
       obey pam restrictions = yes
    ;   template shell = /bin/bash
    
       socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192
    
       local master = no
       os level = 33
    ;  domain master = yes
    ;  preferred master = yes
    
    ;   idmap uid = 10000-20000
    ;   idmap gid = 10000-20000
       winbind enum users = yes
       winbind enum groups = yes
       winbind refresh tickets = yes
       client use spnego = yes
       client ntlmv2 auth = yes
    
       wins server = dcontroller.domain.com
    
       dns proxy = no
    
    # 8. File Naming Options:
    # Case Preservation can be handy - system default is _no_
    # NOTE: These can be set on a per share basis
    ;  preserve case = no
    ;  short preserve case = no
    # Default case is normally upper case for all DOS files
    ;  default case = lower
    # Be very careful with case sensitivity - it can break things!
    ;  case sensitive = no
    
        dos charset = ASCII
        unix charset = UTF8
        display charset = UTF8
    
    #============================ Share Definitions ==============================
    [homes]
       comment = Home Directories
       browseable = no
       writable = yes
    # You can enable VFS recycle bin on a per share basis:
    # Uncomment the next 2 lines (make sure you create a
    # .recycle folder in the base of the share and ensure
    # all users will have write access to it. See
    # examples/VFS/recycle/REAME in the samba docs for details
    ;   vfs object = /usr/lib/samba/vfs/recycle.so
    
    # [documentation]
    #    path = /home/documentation
    #    comment = Public Documentation Directory
    #    browseable = yes
    #    writable = yes
    #    public = yes

    The following is nsswitch.conf:
    Code:
    #
    # /etc/nsswitch.conf
    #
    # An example Name Service Switch config file. This file should be
    # sorted with the most-used services at the beginning.
    #
    # The entry '[NOTFOUND=return]' means that the search for an
    # entry should stop if the search in the previous entry turned
    # up nothing. Note that if the search failed due to some other reason
    # (like no NIS server responding) then the search continues with the
    # next entry.
    #
    # Valid entries include:
    #
    #       nisplus                 Use NIS+ (NIS version 3)
    #       nis                     Use NIS (NIS version 2), also called YP
    #       dns                     Use DNS (Domain Name Service)
    #       files                   Use the local files
    #       db                      Use the local database (.db) files
    #       compat                  Use NIS on compat mode
    #       hesiod                  Use Hesiod for user lookups
    #       [NOTFOUND=return]       Stop searching if not found so far
    #
    
    # To use db, put the "db" in front of "files" for entries you want to be
    # looked up first in the databases
    #
    # Example:
    #passwd:    db files nisplus nis
    #shadow:    db files nisplus nis
    #group:     db files nisplus nis
    
    passwd:     compat winbind
    shadow:     compat winbind
    group:      compat winbind
    
    #hosts:     db files nisplus nis dns
    hosts:      files dns winbind
    
    # Example - obey only what nisplus tells us...
    #services:   nisplus [NOTFOUND=return] files
    #networks:   nisplus [NOTFOUND=return] files
    #protocols:  nisplus [NOTFOUND=return] files
    #rpc:        nisplus [NOTFOUND=return] files
    #ethers:     nisplus [NOTFOUND=return] files
    #netmasks:   nisplus [NOTFOUND=return] files
    
    bootparams: nisplus [NOTFOUND=return] files
    
    ethers:     db files
    netmasks:   files
    networks:   files dns
    protocols:  db files
    rpc:        db files
    services:   db files
    
    netgroup:   files
    
    # publickey:  nisplus
    
    automount:  files
    aliases:    files


    resolv.conf has the following information:

    Code:
    domain domain.com
    search domain.com
    nameserver 192.168.1.254

    I have no problem pinging its' ip address, and accessing it via typing its' ip, but not able to access or ping it by it's hostname server-1.


    Would really appreciate any assitance into this.

  2. #2
    Trusted Penguin
    Join Date
    May 2011
    Posts
    4,307
    Quote Originally Posted by anony_alien View Post
    Having troubles getting centos hostname to be resolved.

    Server is running CentOS release 6.3 (Final)

    can't ping it, and when i nslookup the name, local dns server does not see it.
    Hi,

    In order to resolve your hostname locally, just enter the hostname in the file /etc/hosts, using the ip address that you normally use to access it, e.g.:

    Code:
    192.168.1.2       server-1
    If you need to resolve it from another host on the network, you can put the same entry in that files /etc/hosts file. If you want to resolve the ip address from the internet, then yeah, you need an FQDN and a DNS record. You probably don't need that, though.

    I'm having troubles with smb, it does not start for some unknown error which I don't understand what to fix as the messages from the log is not detailed on trying to start
    samba

    Code:
    Nov  7 14:44:04 dataprobe-1 smbd[14186]: [2012/11/07 14:44:04.476049,  0] smbd/server.c:1156(main)
    Nov  7 14:44:04 dataprobe-1 smbd[14186]:   error opening config file
    Where is the smb.conf file that you posted located on your filesystem? It should be here:
    Code:
    # ls -l /etc/samba/smb.conf
    -rw-r--r-- 1 root root 11835 May 21 00:29 /etc/samba/smb.conf

  3. #3
    Just Joined!
    Join Date
    Jun 2007
    Posts
    20
    Quote Originally Posted by atreyu View Post
    Hi,

    In order to resolve your hostname locally, just enter the hostname in the file /etc/hosts, using the ip address that you normally use to access it, e.g.:

    Code:
    192.168.1.2       server-1
    If you need to resolve it from another host on the network, you can put the same entry in that files /etc/hosts file. If you want to resolve the ip address from the internet, then yeah, you need an FQDN and a DNS record. You probably don't need that, though.


    Where is the smb.conf file that you posted located on your filesystem? It should be here:
    Code:
    # ls -l /etc/samba/smb.conf
    -rw-r--r-- 1 root root 11835 May 21 00:29 /etc/samba/smb.conf

    Thanks for the reply atreyu,

    For the DNS part,
    I have a dns server which resolves the names using dnsmasq service, it's only for local use,
    I don't want to do it by the hosts file, as I want to pick it up automatically from my dns server, no need for a fqdn record, just internal use.


    SMB file:
    smb file is locate in /etc/samba/smb.conf:

    Code:
    [root@server-1 samba]# pwd
    /etc/samba
    [root@server-1 samba]#  ls -l
    total 28
    -rw-r--r--. 1 root         root             20 Jun 22 22:18 lmhosts
    -rw-r--r--. 1 user domain admins  2709 Oct 31 18:51 smb.conf
    -rw-r--r--. 1 root         root          10299 Oct 10 11:08 smb.conf.bak
    -rw-r--r--. 1 root         root           2780 Oct 26 13:49 smbconf.bak
    -rw-r--r--. 1 root         root             97 Jun 22 22:18 smbusers

  4. #4
    Just Joined!
    Join Date
    Jun 2007
    Posts
    20
    Quote Originally Posted by anony_alien View Post
    Thanks for the reply atreyu,

    For the DNS part,
    I have a dns server which resolves the names using dnsmasq service, it's only for local use,
    I don't want to do it by the hosts file, as I want to pick it up automatically from my dns server, no need for a fqdn record, just internal use.


    SMB file:
    smb file is locate in /etc/samba/smb.conf:

    Code:
    [root@server-1 samba]# pwd
    /etc/samba
    [root@server-1 samba]#  ls -l
    total 28
    -rw-r--r--. 1 root         root             20 Jun 22 22:18 lmhosts
    -rw-r--r--. 1 user domain admins  2709 Oct 31 18:51 smb.conf
    -rw-r--r--. 1 root         root          10299 Oct 10 11:08 smb.conf.bak
    -rw-r--r--. 1 root         root           2780 Oct 26 13:49 smbconf.bak
    -rw-r--r--. 1 root         root             97 Jun 22 22:18 smbusers

    Forgot to mention that nmb is also failing to start, and
    it's something to do with smb.conf i believe.

  5. #5
    Trusted Penguin
    Join Date
    May 2011
    Posts
    4,307
    Quote Originally Posted by anony_alien View Post
    I have a dns server which resolves the names using dnsmasq service, it's only for local use,
    I don't want to do it by the hosts file, as I want to pick it up automatically from my dns server, no need for a fqdn record, just internal use.
    so have you tried to configure dnsmasq to resolve local addresses and it is not working? i've never used dnsmasq, but i'm sure there has to be some sort of configuration you need to do first. maybe in /etc/dnsmasq.conf (see the local= parameter for example). also read up on the man page, if you haven't already:
    Code:
    man dnsmasq

    Code:
    [root@server-1 samba]# pwd
    /etc/samba
    [root@server-1 samba]#  ls -l
    total 28
    -rw-r--r--. 1 root         root             20 Jun 22 22:18 lmhosts
    -rw-r--r--. 1 user domain admins  2709 Oct 31 18:51 smb.conf
    -rw-r--r--. 1 root         root          10299 Oct 10 11:08 smb.conf.bak
    -rw-r--r--. 1 root         root           2780 Oct 26 13:49 smbconf.bak
    -rw-r--r--. 1 root         root             97 Jun 22 22:18 smbusers
    that smb.conf file is group-owned by "domain admins"? i've never seen/used a group w/spaces, interesting. can you put the default smb.conf back (with root ownership) and restart, just to see if you can get it to work that way?

    Also is there any additional info in /var/log/messages or the samba logs (usually in the /var/log/samba/ dir)?

  6. #6
    Just Joined!
    Join Date
    Jun 2007
    Posts
    20
    Thanks for getting back atreyu,


    dnsmasq is already configured on another server, and working perfectly well.

    all other servers are resolved well, its only with the centos hosts I'm having trouble getting to resolve.

    Yeah, you are right there are logs in /var/log/samba/

    on commencing the code:

    Code:
     
    
    tail -f log.smbd
    and on trying to start the service

    Code:
    service smb start

    it fails and on the the message on log.smbd

    Code:
    [2012/11/08 12:44:49,  0] smbd/server.c:1141(main)
      smbd version 3.5.10-125.el6 started.
      Copyright Andrew Tridgell and the Samba Team 1992-2010
    [2012/11/08 12:44:49.054235,  1] ../lib/util/params.c:513(OpenConfFile)
      params.c:OpenConfFile() - Unable to open configuration file "/etc/samba/smb.conf":
            Permission denied
    [2012/11/08 12:44:49.054895,  0] smbd/server.c:1156(main)
      error opening config file


    I did try to bring back smb conf, that will work, but then,
    active directory integtration does not work.

    As I binded it to our active directory.





    Quote Originally Posted by atreyu View Post
    so have you tried to configure dnsmasq to resolve local addresses and it is not working? i've never used dnsmasq, but i'm sure there has to be some sort of configuration you need to do first. maybe in /etc/dnsmasq.conf (see the local= parameter for example). also read up on the man page, if you haven't already:
    Code:
    man dnsmasq


    that smb.conf file is group-owned by "domain admins"? i've never seen/used a group w/spaces, interesting. can you put the default smb.conf back (with root ownership) and restart, just to see if you can get it to work that way?

    Also is there any additional info in /var/log/messages or the samba logs (usually in the /var/log/samba/ dir)?

  7. #7
    Trusted Penguin
    Join Date
    May 2011
    Posts
    4,307
    Quote Originally Posted by anony_alien View Post
    dnsmasq is already configured on another server, and working perfectly well.

    all other servers are resolved well, its only with the centos hosts I'm having trouble getting to resolve.
    Is it working on other DNS clients that are Linux hosts, or are they Windows hosts?

    you have this in /etc/resolv.conf:
    Code:
    nameserver 192.168.1.254
    I assume that is the ip address of the dnsmasq server?

    Code:
    [2012/11/08 12:44:49,  0] smbd/server.c:1141(main)
      smbd version 3.5.10-125.el6 started.
      Copyright Andrew Tridgell and the Samba Team 1992-2010
    [2012/11/08 12:44:49.054235,  1] ../lib/util/params.c:513(OpenConfFile)
      params.c:OpenConfFile() - Unable to open configuration file "/etc/samba/smb.conf":
            Permission denied
    [2012/11/08 12:44:49.054895,  0] smbd/server.c:1156(main)
      error opening config file
    I did try to bring back smb conf, that will work, but then,
    active directory integtration does not work.

    As I binded it to our active directory.
    so can try using your AD-modified smb.conf file, but just make it owned by root:root?

  8. #8
    Just Joined!
    Join Date
    Jun 2007
    Posts
    20
    Quote Originally Posted by atreyu View Post
    Is it working on other DNS clients that are Linux hosts, or are they Windows hosts?

    you have this in /etc/resolv.conf:
    Code:
    nameserver 192.168.1.254
    I assume that is the ip address of the dnsmasq server?


    so can try using your AD-modified smb.conf file, but just make it owned by root:root?
    Correct, 192.168.1.254 is the dns server with dnsmasq.


    I did change the smb.conf
    to root:root ownership permissions

    as follows:

    Code:
    sudo chown root smb.conf
    
    sudo chgrp root smb.conf
    Code:
    ls -l 
    
    
    -rw-r--r--. 1 root root    20 Jun 22 22:18 lmhosts
    -rw-r--r--. 1 root root  2709 Oct 31 18:51 smb.conf
    -rw-r--r--. 1 root root 10299 Oct 10 11:08 smb.conf.bak
    -rw-r--r--. 1 root root  2780 Oct 26 13:49 smbconf.bak
    -rw-r--r--. 1 root root    97 Jun 22 22:18 smbusers

    Code:
    getfacl smb.conf
    
    # file: smb.conf
    # owner: root
    # group: root
    user::rw-
    group::r--
    other::r--

    Code:
    sudo service smb start
    Still no luck, it fails to start

    Code:
    Starting SMB services:                                     [FAILED]



    cheers,

  9. #9
    Trusted Penguin
    Join Date
    May 2011
    Posts
    4,307
    Re: DNS

    1. what about your other DNS clients that you say are working: are any of them Linux?

    2. do you have root on the dnsmasq server? i.e., can you check the config/logs?


    Re: Samba

    1. to be clear, is only the AD-modified smb.conf not working? When you've changed the permissions to root:root on the file, do the logs still report "unable to open configuration file"?

    2. how about SELinux, is that on? Check with:
    Code:
    getenforce

  10. #10
    Just Joined!
    Join Date
    Jun 2007
    Posts
    20
    thanks Atreyu for the reply,

    1) Yes, there are linux clients, most ubuntu and gentoo clients.


    2) SElinux is set to enforcing on:

    'getenforce'


    Code:
    
    Enforcing

    Could it be the problem, should I disable selinux?



    2) Yes there is root on dnsmasq server


    After I changed the permissions for smb.conf to root:root, permission denied is the same, I have a feeling that some of the lines probably in smb.conf
    are not read properly or something and that is the reason.

    the message on /var/log/samba/log.smbd:

    Code:
    [2012/11/08 17:06:40,  0] smbd/server.c:1141(main)
      smbd version 3.5.10-125.el6 started.
      Copyright Andrew Tridgell and the Samba Team 1992-2010
    [2012/11/08 17:06:40.061792,  1] ../lib/util/params.c:513(OpenConfFile)
      params.c:OpenConfFile() - Unable to open configuration file "/etc/samba/smb.conf":
            Permission denied
    [2012/11/08 17:06:40.062526,  0] smbd/server.c:1156(main)
      error opening config file
    and on var/log/messages it says:


    Code:
    Nov  8 17:06:40 dataprobe-1 smbd[19656]: [2012/11/08 17:06:40.062526,  0] smbd/server.c:1156(main)
    Nov  8 17:06:40 dataprobe-1 smbd[19656]:   error opening config file

Page 1 of 2 1 2 LastLast

Posting Permissions

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