[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 259
  • Last Modified:

Slackware how to set domain using DHCP

I am running Slackware 14.1 kernel 3.14.24-smp. This host get's it IP via DHCP. My problem is that when booting, during initial DHCP/IP negotiation,  I see a message to the effect: "unable to determine fully qualified domain name". Running `hostname` gives:
$ hostname -f
# (a few second delay ...)
viao

Open in new window

Why does my DHCP server (also Linux) not "set" the domain name? My /etc/HOSTNAME file is:

viao

and /etc/hosts is:

127.0.0.1               localhost
127.0.0.1               viao

/etc/resolv.conf has:

domain hprs.local
nameserver 192.168.0.2
nameserver 192.168.1.1

I was running Ubuntu on this same machine and the domain name seemed to get set OK. It has a /etc/hostname file, not /etc/HOSTNAME, but it, /etc/hosts and /etc/resolv.conf contained the same thing (with the exception of the 192.168.1.1 nameserver which is likely from the wlan0's different DHCP server).

What's up? Do I need some additional DHCP client parameters?
0
jmarkfoley
Asked:
jmarkfoley
  • 6
  • 5
1 Solution
 
arnoldCommented:
Mark,

Dhcp only allocates an IP and can set certain parameters domain, name servers, time servers, etc.

He delay is because of your setup the nsswitch.conf setting for hosts: is what gets consulted for the response. So it checks one resource, and when nothing is found it looks/consult files.

The hostname, is configured manually. Hostname new name should do the trick.
There should be a startup script that loads up a config file/settings often the name include network. Have not slackware in a long time,...
0
 
arnoldCommented:
/etc/resolv.conf lonely deals with name service/dns you can add searchdomain HPRS..local  which will help when searching for hostname it will append the searchdomain in one of the lookup attempts.
0
 
jmarkfoleyAuthor Commented:
Arnold:
The hostname, is configured manually. Hostname new name should do the trick.
hello again! ...

Yes, the hostname is configured in /etc/HOSTNAME and is not a problem. I'm setting that. The domainname is hprs.local and is, in fact set in the /etc/resolv.conf apparently by dhcpd:
$ cat /etc/resolv.conf
# Generated by dhcpcd from eth1, wlan0
# /etc/resolv.conf.head can replace this line
domain hprs.local
nameserver 192.168.0.2
nameserver 192.168.1.1
# /etc/resolv.conf.tail can replace this line

Open in new window

It says right there in /etc/resolv.conf that the domain is hprs.local, so why nothing shown with `hostname -f`? Likewise nothing with domainname, dnsdomainame and nisdomainname. As I mentioned, this did work with Ubuntu, so I'm wondering if there is a setting I need for dhcpcd.conf.
you can add searchdomain HPRS..local  which will help when searching for hostname it will append the searchdomain in one of the lookup attempts.
Setting "search hprs.local" in /etc/resolv.conf didn't help.

In fact, /etc/dhcpcd.conf does have:

option domain_name_servers, domain_name, domain_search, host_name

so, I don't get why I can't list the domain name.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
arnoldCommented:
Hostname does not combine the hostname+domain name.
If you modify your /etc/hosts to have 127.0.0.1 viao viao.hprs.local

If I am not mistaken, will still not be reported to a hostname query, tough I might be wrong.

presumably, the samba/ldap schema will appear similar to the AD Which only uses the hostname portion of records for joined systems.


/etc/resolv.conf is parameter setting for the named/DNS substructure and is not one consulted by hostname.
If use nslookup hostname, the domain will be appended in the DNS lookup query.
0
 
arnoldCommented:
Changes to hosts file to include viao.hprs.local may do what you are looking, alternatively, using hostname -A might get you a response that includes all the variations ......
0
 
jmarkfoleyAuthor Commented:
If use nslookup hostname, the domain will be appended in the DNS lookup query.
That is true and works from the DC/DNS, but not from the client. This client host is not actually joined to the domain, however. Maybe that makes a difference.

If use nslookup hostname, the domain will be appended in the DNS lookup query.
Likewise, not on the DHCP client host.

Changes to hosts file to include viao.hprs.local may do what you are looking,
Yes, I know it would. However, I could have sworn that my Ubuntu installation didn't need me to set the domain name locally anywhere. Perhaps I'm mistaken. Or maybe some helper program like networkmanager did the job. I may have to create a Ubuntu host to satisfy my itch.
0
 
arnoldCommented:
The hostname -f consults including /etc/hosts.
Often the hosts file is configured with IP hostname FQDN

Though most of the time, FQDN is left to the DNS where the internal reference only use then hostname.
0
 
jmarkfoleyAuthor Commented:
I have put the FDQN (viao.hprs.local) in /etc/HOSTNAME and /etc/hosts. It appears that only /etc/rc.d/rc.M looks at /etc/HOSTNAME and then only to extract the hostname only part to set the hostname via the /bin/hostname command.

Once the FDQN is set in /etc/hosts the `hostname -f` command works.

Hmmm, but I remember ... Ubuntu ... oh well, moving on!
0
 
jmarkfoleyAuthor Commented:
I closed this after successfully getting `hostname -f` with the FDQN and being able to do `host <name>` to various hosts on the LAN. Shortly thereafter, neither of those worked -- I didn't do nuthin! Frustrating. Will repost a new question.
0
 
arnoldCommented:
Not sure I understand. Do you want this question reopened
host is a named name resolution command.
0
 
jmarkfoleyAuthor Commented:
Do you want this question reopened
No, see new question: http://www.experts-exchange.com/Networking/Linux_Networking/Q_28610925.html. It's just that if I had seen the problem earlier I would have continued in this question.
0

Featured Post

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

  • 6
  • 5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now