9

I have just installed ubuntu 12.04. And I am a beginner on Linux. So, how can I add the DNS suffix in this OS. Please help..

user181765
  • 91
  • 1
  • 1
  • 2
  • Right now I got no Ubuntu install to test this with, but the normal way to do this is by adding a new line with search mydomain.tld in /etc/resolv.conf – Hennes Aug 06 '13 at 08:43
  • Could you explain what you mean by DNS suffix? – Oli Aug 06 '13 at 09:21

4 Answers4

10

In the past you did this by modifying /etc/resolv.conf. Now /etc/resolv.conf is managed by resolvconf. So now you do:

  • Create a file named /etc/resolvconf/resolv.conf.d/tail
  • Add the line search mydomain.tld to that file
  • Run sudo resolvconf -u
Pace
  • 209
  • 1
  • 5
4

For static ipaddresses this can be defined in /etc/network/interfaces eg:

dns-search na.my-domain.net

see What does the dns-search option mean in /etc/network/interfaces?

tc7
  • 41
  • 3
1

In Debian and Ubuntu the system hostname is a short name --- this name does not have a domain name suffix. Domain name suffixes for a machine are determined by DNS which is outside the machine itself.

Certain applications running on the local machine need to be given one or more fully qualified domain names for the local machine. Those applications should be configured accordingly.

jdthood
  • 12,467
0

I have achieved this by adding...

append domain-name "na.my-domain.net";

to..

/etc/dhcp/dhclient.conf

and then...

sudo restart network-manager
Jordan
  • 669
  • 1
  • 5
  • 12