Forum: 

How do I set the domain?

Nigel George's picture

I'm new to both turnkey and debian, I'd like to add my VM to my domain. i.e. core.localdomain.co.uk would be it's FQDN

I've set /etc/hostname to core

I've set /etc/hosts to 127.0.0.1 core.localdomain.co.uk core localhost

However the domainname command still returns (none) which is puzzling me.

On Gentoo I just modify /etc/conf.d/net and add dns_domain_lo="localdomain.co.uk" and nis_domain_lo="localdomain.co.uk", restart and voila it works.

I know this is a newbie question, so I do apologize, I just couldn't find a simple answer to this on google.

Jeremy Davis's picture

So assuming that you have a local DNS server (that handles DNS queries for localdomain.co.uk) then you just need to add an 'A' record in there that points your server name (core) to it's IP. Then all should be well...

Nigel George's picture

Ahh okay, I don't yet have a DNS server, this is going to be my local DNS Server for my LAN sitting in a VM. First time doing a DNS server, hopefully this guide is a decent one http://mixeduperic.com/ubuntu/seven-easy-steps-to-setting-up-an-interal-...

Jeremy Davis's picture

But it looks all fair and reasonable to me. The only thing which you may run across is that sometime Debian packages have different naems for things, but OTTOMH you shouldn't run across this for installing bind.

BTW there is also a Webmin module for configuring Bind, it's called webmin-bind8 (no that's not a typo, it was built for bind8 but still works fine with bind9). You can install it with apt-get when you install the other packages. I still think that initially it is easier (and more reliable) to set it all up manually initially, but when adding extra names later the Webmin module is good IMO.

Ric Moore's picture

Try typing "hostname" instead. Then "hostname -f"

I think localhost doen't count as a "domainname".  Ric

Post new comment