View previous topic :: View next topic |
Author |
Message |
salmonix Guru
Joined: 16 Jul 2006 Posts: 410
|
Posted: Tue Jun 24, 2008 2:29 pm Post subject: Setting domainname |
|
|
Can sb explain me the differences of setting domainname in
1) /etc/conf.d/domainname,
2) /etc/conf.d/net file,
3) /etc/sysctl.conf
4) /etc/hosts ?
and probably their relation with dnsmasq domain option?
Thnx! _________________ Quis custodiet ipsos, custodes? |
|
Back to top |
|
|
UberLord Retired Dev
Joined: 18 Sep 2003 Posts: 6835 Location: Blighty
|
|
Back to top |
|
|
salmonix Guru
Joined: 16 Jul 2006 Posts: 410
|
Posted: Tue Jul 01, 2008 11:09 am Post subject: |
|
|
Thanx. It was merely a question risen after reading some controversal docs and the picture i felt not clear. _________________ Quis custodiet ipsos, custodes? |
|
Back to top |
|
|
Ph0eniX Guru
Joined: 24 Sep 2004 Posts: 502 Location: New York, U.S.
|
Posted: Tue Jul 01, 2008 1:14 pm Post subject: |
|
|
UberLord wrote: | /etc/conf.d/domainname isn't used anymore
/etc/conf.d/net can set a DNS or NIS domain name
/etc/sysctl.conf only sets a NIS domain name
/etc/hosts doesn't set any domain names as such - is purely a name -> ip lookup table
First ask why you need to set a DNS domain name, as 99% of the time you are wrong.
Making the unknown_domain go away on your terminal login isn't a valid answer |
The thing is that if you don't set your FQDN in /etc/hosts, hostname -f will not work. Ironically when I do, then my PPTP connection stops working. Go figure. |
|
Back to top |
|
|
UberLord Retired Dev
Joined: 18 Sep 2003 Posts: 6835 Location: Blighty
|
|
Back to top |
|
|
depontius Advocate
Joined: 05 May 2004 Posts: 3509
|
Posted: Tue Jul 01, 2008 3:42 pm Post subject: |
|
|
I don't know about Ph0eniX, but I frequently need an FQDN, in order to run CAD (Computer Aided Design) tools when I'm working from home. Many of these tools have all sorts of licensing crap built-in, and for one particular tool suite, I have to have a forward and reverse resolvable FQDN that appears to be inside my employer's domain. If I don't have that, I get to sit waiting for all sorts of time-outs, and so far have never gotten any useful work done without the FQDN properly set. Maybe the software is broken, and I would agree with that assessment for other reasons, but it's what my employer has chosen for use on our designs, so we don't really have a viable choice. File-level compatibility, standards, I wish!
Incidentally, to set my FQDN to be "at work" I use the IP assigned through my employer's VPN and find the associated FQDN through a DNS lookup. Then I craft an entry in /etc/hosts to match, and use "hostname (shortname)" to set the name. After that, "hostname -f" returns the FQDN properly, even though I've only set the shortname. The shortname plus /etc/hosts is sufficient. The CAD software runs. _________________ .sigs waste space and bandwidth |
|
Back to top |
|
|
UberLord Retired Dev
Joined: 18 Sep 2003 Posts: 6835 Location: Blighty
|
Posted: Tue Jul 01, 2008 3:53 pm Post subject: |
|
|
depontius wrote: | I don't know about Ph0eniX, but I frequently need an FQDN, in order to run CAD (Computer Aided Design) tools when I'm working from home. Many of these tools have all sorts of licensing crap built-in, and for one particular tool suite, I have to have a forward and reverse resolvable FQDN that appears to be inside my employer's domain. If I don't have that, I get to sit waiting for all sorts of time-outs, and so far have never gotten any useful work done without the FQDN properly set. Maybe the software is broken, and I would agree with that assessment for other reasons, but it's what my employer has chosen for use on our designs, so we don't really have a viable choice. File-level compatibility, standards, I wish! |
That's probably the first valid reason I've heard for setting a FQDN like that!
Quote: | Incidentally, to set my FQDN to be "at work" I use the IP assigned through my employer's VPN and find the associated FQDN through a DNS lookup. Then I craft an entry in /etc/hosts to match, and use "hostname (shortname)" to set the name. After that, "hostname -f" returns the FQDN properly, even though I've only set the shortname. The shortname plus /etc/hosts is sufficient. The CAD software runs. |
Could do better
Install openresolv
Install a decent local resolver, like dnsmasq
Configure /etc/dnsmasq.conf according to /etc/resolvconf/update.d/dnsmasq
DHCP clients always wang their domains entries in "search".
OpenVPN wangs the domain in "domain". If you don't use OpenVPN in Gentoo, you'll need to make your VPN client 1) use resolvconf, and 2) wang the domain in domain if it uses search.
This enables all DNS queries for the VPN domain to goto the VPN server and all other queries to the DNS server specified by the DHCP client. _________________ Use dhcpcd for all your automated network configuration needs
Use dhcpcd-ui (GTK+/Qt) as your System Tray Network tool |
|
Back to top |
|
|
depontius Advocate
Joined: 05 May 2004 Posts: 3509
|
Posted: Tue Jul 01, 2008 8:27 pm Post subject: |
|
|
UberLord wrote: | depontius wrote: | Incidentally, to set my FQDN to be "at work" I use the IP assigned through my employer's VPN and find the associated FQDN through a DNS lookup. Then I craft an entry in /etc/hosts to match, and use "hostname (shortname)" to set the name. After that, "hostname -f" returns the FQDN properly, even though I've only set the shortname. The shortname plus /etc/hosts is sufficient. The CAD software runs. |
Could do better
Install openresolv
Install a decent local resolver, like dnsmasq
Configure /etc/dnsmasq.conf according to /etc/resolvconf/update.d/dnsmasq
DHCP clients always wang their domains entries in "search".
OpenVPN wangs the domain in "domain". If you don't use OpenVPN in Gentoo, you'll need to make your VPN client 1) use resolvconf, and 2) wang the domain in domain if it uses search.
This enables all DNS queries for the VPN domain to goto the VPN server and all other queries to the DNS server specified by the DHCP client. |
I tried the "resolvconf" package a while ago, shortly after it first arrived for Gentoo. It didn't work for me, something wasn't getting triggered, because the directory structures seemed to be there, but the final result wasn't. I scripted a few kludges to force it to work, and then decided to just bag it, and script stuff myself to do what it did.
I am running dnsmasq, principally to act as a versatile resolver, as you suggest. The caching is unimportant in this situation, and can be a hindrance when the VPNs are coming up and going down, and I forget what my status is, and get a bogus resolution stuck in the cache.
I also run both OpenVPN for my own endpoint, and my employer's VPN for work access. Getting the latter to play well may be the biggest reason to stay scripted, rather than some more standard solution that presumes cooperative, friendly software.
But just in case, does openresolv work better than resolvconf did? (Or did you never have problems with either?) _________________ .sigs waste space and bandwidth |
|
Back to top |
|
|
UberLord Retired Dev
Joined: 18 Sep 2003 Posts: 6835 Location: Blighty
|
Posted: Wed Jul 02, 2008 9:11 am Post subject: |
|
|
depontius wrote: | I tried the "resolvconf" package a while ago, shortly after it first arrived for Gentoo. It didn't work for me, something wasn't getting triggered, because the directory structures seemed to be there, but the final result wasn't. I scripted a few kludges to force it to work, and then decided to just bag it, and script stuff myself to do what it did. |
...
But just in case, does openresolv work better than resolvconf did? (Or did you never have problems with either?)[/quote]
You should have reported your issues so we could try and make it work how you like it.
openresolv does work better than resolvconf-gentoo and does fix some issues.
I never have a problem using my own software - or I wouldn't release it
So lets chat about it.
How about wanging openresolv in (it's available in Gentoo) and if you have any issues with it then open a bug at http://bugs.marples.name/enter_bug.cgi?product=openresolv _________________ Use dhcpcd for all your automated network configuration needs
Use dhcpcd-ui (GTK+/Qt) as your System Tray Network tool |
|
Back to top |
|
|
depontius Advocate
Joined: 05 May 2004 Posts: 3509
|
Posted: Wed Jul 02, 2008 12:34 pm Post subject: |
|
|
UberLord wrote: | You should have reported your issues so we could try and make it work how you like it.
openresolv does work better than resolvconf-gentoo and does fix some issues.
I never have a problem using my own software - or I wouldn't release it
So lets chat about it.
How about wanging openresolv in (it's available in Gentoo) and if you have any issues with it then open a bug at http://bugs.marples.name/enter_bug.cgi?product=openresolv |
I think I did report it at the time, but there were others making much more noise than me, and I was able to fix things on my own. I probably won't have the laptop back in the cradle until after the holidays, but I'll give "openresolv" a shot, then. As I said, I'm just a little fearful of making this work with the proprietary VPN software from my employer, but I'll see what I can do. _________________ .sigs waste space and bandwidth |
|
Back to top |
|
|
hem n00b
Joined: 16 Nov 2008 Posts: 4
|
Posted: Sun Nov 16, 2008 8:59 pm Post subject: |
|
|
My reason to set domainname:
I need to set a domainname for a software license. If its not set properly. the software don't start.
What i tryed:
1) /etc/conf.d/domainname -> is set, don't work
2) /etc/conf.d/net file -> (dns_domain_eth0="domainname") don't work and end in a little drawback, resolv.conf will be overwritten and kill nameserver settings on each start
3) /etc/sysctl.conf -> no idea whats to do here
4) /etc/hosts ? -> is set properly but don't affect domainname (only hostname -f works, but the software license ignore that)
5) The settomainname prog i found on this forum -> only work with a hostname like "hostname.domainname" with ends in a "hostname.domainname.domainname" on login with some routing trouble
So how can i set the domainname on startup?
Any help would be appreciated. |
|
Back to top |
|
|
depontius Advocate
Joined: 05 May 2004 Posts: 3509
|
Posted: Sun Nov 16, 2008 11:14 pm Post subject: |
|
|
I'm surprised you can't get it to work in /etc/conf.d/net - that's how I do it on my work machines. I'll check mine tomorrow and post. In the meantime you might post yours here.
I'm guessing that you're using dhcp. Is this on a laptop that moves to other networks, or a deskside that stays on your employer's lan? I have a static IP deskside at work, and that's simple. I also have a laptop that moves, and I handle the domain name on that with custom scripting. The case of a deskside with dhcp is simpler, in that /etc/conf.d/net will work, but you have to give it the right dhcp flags, as well. Basically, you don't want dhcp to overwrite /etc/resolv.conf, and you want to properly configure it yourself. _________________ .sigs waste space and bandwidth |
|
Back to top |
|
|
hem n00b
Joined: 16 Nov 2008 Posts: 4
|
Posted: Mon Nov 17, 2008 6:15 am Post subject: |
|
|
I use a static ip. My conf.d/net is:
Code: | modules=( "ifconfig" )
config_eth0=( "192.168.100.65 broadcast 192.168.100.255 netmask 255.255.255.0" )
routes_eth0=( "default via 192.168.100.1" )
dns_domain="net"
dns_domain_eth0="net"
dns_domain_lo="net"
dns_servers_eth0="192.168.100.1" |
But i don't think that the software is interested on interface settings. It parse the output of the domainname command to check the license-identifier of the machine. |
|
Back to top |
|
|
UberLord Retired Dev
Joined: 18 Sep 2003 Posts: 6835 Location: Blighty
|
|
Back to top |
|
|
depontius Advocate
Joined: 05 May 2004 Posts: 3509
|
Posted: Mon Nov 17, 2008 10:40 am Post subject: |
|
|
UberLord wrote: |
The domainname command is for the NIS domain, not the DNS domain. |
Well that's fascinating, to have a buried dependence on NIS like that. How prevalent was NIS, in it's day? I guess I figured they just parsed "hostname -f". _________________ .sigs waste space and bandwidth |
|
Back to top |
|
|
hem n00b
Joined: 16 Nov 2008 Posts: 4
|
Posted: Mon Nov 17, 2008 7:24 pm Post subject: |
|
|
Ok, then i need to set NIS. My setting in /etc/domainname for NIS is the same as DNS. It seems i have to set some more.
The prog from genome https://forums.gentoo.org/viewtopic-t-51538-highlight-setdomainname.html takes the right NIS setting, but it should use the settings from /etc/domainname instead of hostname. Can anyone change the code on this way? |
|
Back to top |
|
|
UberLord Retired Dev
Joined: 18 Sep 2003 Posts: 6835 Location: Blighty
|
|
Back to top |
|
|
depontius Advocate
Joined: 05 May 2004 Posts: 3509
|
Posted: Tue Nov 18, 2008 1:44 pm Post subject: |
|
|
UberLord wrote: | Set nis_domain="net" in conf.d/net |
This looks handy, but if suddenly "domainname" starts returning something other than "(none)" will other programs start assuming that one is using NIS? _________________ .sigs waste space and bandwidth |
|
Back to top |
|
|
UberLord Retired Dev
Joined: 18 Sep 2003 Posts: 6835 Location: Blighty
|
|
Back to top |
|
|
hem n00b
Joined: 16 Nov 2008 Posts: 4
|
Posted: Sat Nov 22, 2008 12:35 pm Post subject: |
|
|
Quote: | nis_domain="net" in conf.d/net |
Works great, thx for the help.
Btw: Setting dns_servers_eth0=... in addition to dns_domainname=... in /etc/conf.d/net will restore the lost DNS settings in /etc/resolv.conf |
|
Back to top |
|
|
|