LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices



Reply
 
Search this Thread
Old 08-20-2013, 11:13 PM   #1
ravisingh1
Member
 
Registered: Apr 2013
Location: Mumbai
Distribution: Ubuntu13.10
Posts: 281

Rep: Reputation: Disabled
What's my systems FQDN?


I had set my cron job but I was not getting any output via mail. I saw
the log 'syslog'. It contained the below:

Quote:
Aug 20 21:00:02 ravbholua-Aspire-5315 sm-msp-queue[14158]: My unqualified host name (ravbholua-Aspire
-5315) unknown; sleeping for retry
Aug 20 21:01:03 ravbholua-Aspire-5315 sm-msp-queue[14158]: unable to qualify my own domain name (ravb
holua-Aspire-5315) -- using short name
The same error was in mail.log.

It seems it is not finding my FQDN. What's then my FQDN?
I searched regarding this issue in net but couldn't get solution. Google
has posts having the same error but nowhere I got how to know my
FQDN.
Please see the below files if it may be of use:
Code:
ravbholua@ravbholua-Aspire-5315:/etc$ cat hosts
127.0.0.1	localhost
127.0.1.1	ravbholua-Aspire-5315

# The following lines are desirable for IPv6 capable hosts
::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ravbholua@ravbholua-Aspire-5315:/etc$
Code:
ravbholua@ravbholua-Aspire-5315:/etc$ cat hostname
ravbholua-Aspire-5315
ravbholua@ravbholua-Aspire-5315:/etc$
 
Old 08-21-2013, 01:42 AM   #2
dob12460
Red Hat Content Author
 
Registered: Nov 2007
Location: Brisbane, Australia
Distribution: RHEL, Fedora
Posts: 29

Rep: Reputation: 4
You might want to update /etc/sysconfig/network with your full hostname.domainname

What you see looks like the default applied when you did the install. You can change that to whatever you like (almost). e.g., you could set it to aspire.mydomain.net or rav.example.net or something similar.

Technically the FQDN ends with a period (.) but for these purposes won't matter afaik.

David
 
Old 08-21-2013, 02:33 AM   #3
ravisingh1
Member
 
Registered: Apr 2013
Location: Mumbai
Distribution: Ubuntu13.10
Posts: 281

Original Poster
Rep: Reputation: Disabled
there is no path /etc/sysconfig/network
There is 1 file and 1 directory named network/s as shown below.
/etc/networks
/etc/network/
where to go now?
Plese see the output below:
Quote:
ravbholua@ravbholua-Aspire-5315:/etc$ cat networks
# symbolic names for networks, see networks(5) for more information
link-local 169.254.0.0
ravbholua@ravbholua-Aspire-5315:/etc$ cd network
ravbholua@ravbholua-Aspire-5315:/etc/network$ ls
if-down.d if-post-down.d if-pre-up.d if-up.d interfaces run
ravbholua@ravbholua-Aspire-5315:/etc/network$ ^C
ravbholua@ravbholua-Aspire-5315:/etc/network$
 
Old 08-22-2013, 06:23 AM   #4
dob12460
Red Hat Content Author
 
Registered: Nov 2007
Location: Brisbane, Australia
Distribution: RHEL, Fedora
Posts: 29

Rep: Reputation: 4
My RHEL system looks like this (with names changed to protect the innocent):

$ cat /etc/sysconfig/network
NETWORKING_IPV6=no
HOSTNAME=myhost.mydomain.net
NETWORKING=yes

On Fedora 19 it's in /etc/hostname

# cat /etc/hostname
fedora19vm.domain.com

I've never used Ubuntu so I don't know what goes on there. You can either create that file (although I don't know if Ubuntu will recognize it), or add your domain info to the /etc/hosts file. How you do that will depend on whether you have fixed IPs set up or not.

Hopefully somebody with Ubuntu networking nous will pipe up with more info.

Cheers
David
 
Old 08-23-2013, 04:26 PM   #5
jefro
Guru
 
Registered: Mar 2008
Posts: 12,087

Rep: Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521
Just as a note. FQDN's are not used normally by home users as such. A FQDN may be google.com or amazon.com or such. You may indeed have a FQDN but if you don't you need to either remove references or as some distro's do they put in a false FQDN that tends to refer to local. You can't really use it as a way to access like you would a normal domain name.
 
Old 08-25-2013, 01:28 PM   #6
MikeDeltaBrown
Member
 
Registered: Apr 2013
Location: Arlington, WA
Distribution: Slackware
Posts: 55

Rep: Reputation: 6
To see what's configured, use `hostname --fqdn`.

FYI, a Fully Qualified Domain Name (FQDN) includes the hostname and the domain name (eg. www.google.com).

To solve the problem you appear to have, I would be looking at your SMTP daemon config. It appears to be sendmail.

Do you have a properly configured NIC?
Is the /etc/hosts entry proper?
Are there files in /etc/mail?
 
Old 08-26-2013, 08:55 AM   #7
ravisingh1
Member
 
Registered: Apr 2013
Location: Mumbai
Distribution: Ubuntu13.10
Posts: 281

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by MikeDeltaBrown View Post
To see what's configured, use `hostname --fqdn`.
Code:
ravbholua@ravbholua-Aspire-5315:/etc/mail$ hostname --fqdn
ravbholua-Aspire-5315
ravbholua@ravbholua-Aspire-5315:/etc/mail$
Quote:
Originally Posted by MikeDeltaBrown View Post
Do you have a properly configured NIC?
Is the /etc/hosts entry proper?
Are there files in /etc/mail?
Regarding NIC, I have no idea.
The entry of /etc/hosts is mentioned in my 1st post in this thread. I mention it again below.
Code:
ravbholua@ravbholua-Aspire-5315:/etc$ cat hosts
127.0.0.1	localhost
127.0.1.1	ravbholua-Aspire-5315

# The following lines are desirable for IPv6 capable hosts
::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ravbholua@ravbholua-Aspire-5315:/etc$
Regarding /etc/mail:
Code:
ravbholua@ravbholua-Aspire-5315:/etc/mail$ ls
access           aliases     helpfile          Makefile  sendmail.cf      sendmail.mc           smrsh          submit.mc
access.db        aliases.db  local-host-names  peers     sendmail.cf.old  service.switch        submit.cf      tls
address.resolve  databases   m4                sasl      sendmail.conf    service.switch-nodns  submit.cf.old  trusted-users
ravbholua@ravbholua-Aspire-5315:/etc/mail$
 
Old 08-26-2013, 10:42 AM   #8
zhjim
Senior Member
 
Registered: Oct 2004
Distribution: Debian Squeeze x86_64
Posts: 1,467
Blog Entries: 11

Rep: Reputation: 184Reputation: 184
The FQDN is taken from /etc/hosts. So correct that line to represent your setup. Also have the correct hostname inside of /etc/hostname.
Code:
cat "your_hostname" > /etc/hostname
But only the hostname, no domainame. After that reread the hostname with
Code:
hostname -F /etc/hostname
This spares a reboot. After this see what the mailer says and maybe do some config there as well as mentioned by Mike

For other host, domain, nis name stuff give man hostname a thorough read.
 
Old 08-27-2013, 08:04 AM   #9
ravisingh1
Member
 
Registered: Apr 2013
Location: Mumbai
Distribution: Ubuntu13.10
Posts: 281

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by zhjim View Post
The FQDN is taken from /etc/hosts. So correct that line to represent your setup.
I have changed my /etc/hosts as:
Code:
ravbholua@ravbholua-Aspire-5315:~$ cat /etc/hosts
127.0.0.1	localhost
127.0.1.1	ravbholua-Aspire-5315.localdomain.com

# The following lines are desirable for IPv6 capable hosts
::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ravbholua@ravbholua-Aspire-5315:~$ cat /etc/hostname
ravbholua-Aspire-5315
/etc/hostname is the same as earlier as I suppose it's my host name.

Please say what the 1st line of /etc/hosts is?(blue colored in above output shown) Is it the hostname of root?

I created a crontab file:
Code:
ravbholua@ravbholua-Aspire-5315:~$ crontab -l
* * * * * echo bholu
Now what should I expect the output should go? In which mail id shoud it go.What's my mail id? Is it what is shown in prompt, i.e. "ravbholua@ravbholua-Aspire-5315"
Is the email id of root is:
Quote:
root@ravbholua-Aspire-5315
I am not getting any mail.
See the output of /var/log/mail.log ( shown for ravbholua)
Code:
Aug 27 14:29:55 ravbholua-Aspire-5315 sm-mta[6065]: r7R8S13d003261: to=<ravbholua@ravbholua-Aspire-53
15>, ctladdr=<ravbholua@ravbholua-Aspire-5315> (1000/1000), delay=00:31:54, xdelay=00:00:00, mailer=l
ocal, pri=390580, dsn=4.0.0, stat=Operating system error
Aug 27 14:29:56 ravbholua-Aspire-5315 sm-mta[6086]: r7R8T181003274: Warning: program /usr/sbin/sensib
le-mda unsafe: No such file or directory
Aug 27 14:29:56 ravbholua-Aspire-5315 sm-mta[6086]: r7R8T181003274: SYSERR(root): Cannot exec /usr/sb
in/sensible-mda: No such file or directory
Below is also a part of the output of the same log file (shown for root)
Quote:
Aug 27 14:29:55 ravbholua-Aspire-5315 sm-mta[6065]: r7R8bxHY004566: to=<root@ravbholua-Aspire-5315>, ctladdr=<root@ravbholua-Aspire-5315> (0/0), delay=00:21:56, xdelay=00:00:00, mailer=local, pri=300942, dsn=4.0.0, stat=Operating system error
Aug 27 14:29:55 ravbholua-Aspire-5315 sm-mta[6084]: r7R8U4am003983: Warning: program /usr/sbin/sensible-mda unsafe: No such file or directory
Aug 27 14:29:55 ravbholua-Aspire-5315 sm-mta[6084]: r7R8U4am003983: SYSERR(root): Cannot exec /usr/sbin/sensible-mda: No such file or directory
Aug 27 14:29:55 ravbholua-Aspire-5315 sm-mta[6065]: r7R8U4am003983: to=<root@ravbholua-Aspire-5315>, ctladdr=<root@ravbholua-Aspire-5315> (0/0), delay=00:29:51, xdelay=00:00:00, mailer=local, pri=301660, dsn=4.0.0, stat=Operating system error
Aug 27 14:29:55 ravbholua-Aspire-5315 sm-mta[6085]: r7R8S13d003261: Warning: program /usr/sbin/sensible-mda unsafe: No such file or directory
But root is gettig mail. This I confirmed when I entered 'sudo -i' and entered as root. Then when I ran command "mailx",it outputs the mails.
But why no mails showing for ravbholua.
Quote:
ravbholua@ravbholua-Aspire-5315:/var/log$ mailx
No mail for ravbholua
----------------------------------------------------------------
OHHHHHH!!! A big issue here I encountered. My internet disconnected and when I try to reconnect, it's not connecting. Then I tried running one script (mentioned below) for connecting it and got the below error message.
Quote:
ravbholua@ravbholua-Aspire-5315:~$ sudo ./mob* start
sudo: unable to resolve host ravbholua-Aspire-5315
[sudo] password for ravbholua:
^C** Message: Caught signal 2, shutting down...
Then I changed the /etc/hosts file to what was earlier. Restarted twice but still net wasn't connecting.
Now , after 2 hours I tried again and it seems a matter of chance than now I could get connected. Uffff!!!
Also earlier, I twice executed the below command after I edited /etc/hosts to include domain name. Is it that this has resulted in my system not connecting to ineternet?????
Quote:
Originally Posted by zhjim View Post
But only the hostname, no domainame. After that reread the hostname with
Code:

hostname -F /etc/hostname

This spares a reboot. After this see what the mailer says and maybe do some config there as well as mentioned by Mike

Last edited by ravisingh1; 08-27-2013 at 08:09 AM.
 
Old 08-27-2013, 09:16 AM   #10
zhjim
Senior Member
 
Registered: Oct 2004
Distribution: Debian Squeeze x86_64
Posts: 1,467
Blog Entries: 11

Rep: Reputation: 184Reputation: 184
You seem to be missing a program. /usr/sbin/sensible-mda But I don't know which package this is in and I say it should have been installed when installing your mailer. Maybe
Code:
apt-cache search sensible-mda
might tell us which packages hold the file.

For root getting mail but not your user. Did you send anymail to your user?

Judging from the way you changed your /etc/hosts file I say you did not read man hosts, did you? You need a fqdn name for your machine and one short one without the domainname. This should also fix the issue with your inet connection script.
The file hosts contains name to ip resolution data. So 127.0.0.1 localhost makes your computer use the ip 127.0.0.1 if you call on localhost. And if you call on ravbholua-Aspire-5315 it also gives back the ip 127.0.0.1. /etc/hosts is just a local DNS type of file.
 
Old 08-27-2013, 09:39 AM   #11
ravisingh1
Member
 
Registered: Apr 2013
Location: Mumbai
Distribution: Ubuntu13.10
Posts: 281

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by zhjim View Post
You seem to be missing a program. /usr/sbin/sensible-mda But I don't know which package this is in and I say it should have been installed when installing your mailer. Maybe
Code:
apt-cache search sensible-mda
might tell us which packages hold the file.
Code:
ravbholua@ravbholua-Aspire-5315:~$ apt-cache search sensible-mda
sensible-mda - Mail Delivery Agent wrapper
ravbholua@ravbholua-Aspire-5315:~$
Oh it didn't tell the package name. Now how to know ?
Quote:
Originally Posted by zhjim View Post
For root getting mail but not your user. Did you send anymail to your user?
When I as user ravbholua use cron, it is supposed to send in ravbholua's email id!But ravbholua isn't getting any mail.
See the crontab file for both ravbholua and root (root has no file)
Code:
ravbholua@ravbholua-Aspire-5315:~$ crontab -l
* * * * * echo bholu 
ravbholua@ravbholua-Aspire-5315:~$ sudo -i
[sudo] password for ravbholua: 
root@ravbholua-Aspire-5315:~# crontab -l
no crontab for root
root@ravbholua-Aspire-5315:~#
 
Old 08-27-2013, 11:09 AM   #12
ravisingh1
Member
 
Registered: Apr 2013
Location: Mumbai
Distribution: Ubuntu13.10
Posts: 281

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by zhjim View Post
You seem to be missing a program. /usr/sbin/sensible-mda But I don't know which package this is in and I say it should have been installed when installing your mailer. Maybe
Code:
apt-cache search sensible-mda
might tell us which packages hold the file.

For root getting mail but not your user. Did you send anymail to your user?
Amazing, the below command worked
Code:
sudo apt-get install sensible-mda
That means the package name is the same.

And my problem seems to be resolved as I (ravbholua) have started getting mails!!!!!!!!!!!!!!!!!
What that means? Does it mean /etc/hosts not reqd. for receiving mails?
Now please see the output fragment of /var/log/mail.log
Code:
Aug 27 20:28:02 ravbholua-Aspire-5315 sendmail[14916]: My unqualified host name (ravbholua-Aspire-531
5) unknown; sleeping for retry
Aug 27 20:28:02 ravbholua-Aspire-5315 sendmail[14824]: unable to qualify my own domain name (ravbholua-Aspire-5315) -- using short name
Aug 27 20:28:02 ravbholua-Aspire-5315 sendmail[14824]: r7REw2dM014824: from=ravbholua, size=283, class=0, nrcpts=1, msgid=<201308271458.r7REw2dM014824@ravbholua-Aspire-5315>, relay=ravbholua@localhost
Aug 27 20:28:03 ravbholua-Aspire-5315 sm-mta[14917]: r7REw2TF014917: from=<ravbholua@ravbholua-Aspire-5315>, size=581, class=0, nrcpts=1, msgid=<201308271458.r7REw2dM014824@ravbholua-Aspire-5315>, proto=ESMTP, daemon=MTA-v4, relay=localhost [127.0.0.1]
Aug 27 20:28:03 ravbholua-Aspire-5315 sendmail[14824]: r7REw2dM014824: to=ravbholua, ctladdr=ravbholua (1000/1000), delay=00:00:01, xdelay=00:00:01, mailer=relay, pri=30283, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (r7REw2TF014917 Message accepted for delivery)
Aug 27 20:28:03 ravbholua-Aspire-5315 sm-mta[14921]: r7REw2TF014917: to=<ravbholua@ravbholua-Aspire-5315>, ctladdr=<ravbholua@ravbholua-Aspire-5315> (1000/1000), delay=00:00:00, xdelay=00:00:00, mailer=local, pri=30829, dsn=2.0.0, stat=Sent
Aug 27 20:29:02 ravbholua-Aspire-5315 sendmail[15007]: My unqualified host name (ravbholua-Aspire-5315) unknown; sleeping for retry
Aug 27 20:29:02 ravbholua-Aspire-5315 sendmail[14916]: unable to qualify my own domain name (ravbholua-Aspire-5315) -- using short name
Also a fragment of the output of mailx command is:
Code:
U  21 Cron Daemon        Tue Aug 27 20:19  22/888   Cron <ravbholua@ravbholua-Aspire-5315> echo bh
 U  22 Mail Delivery Subs Tue Aug 27 20:19  69/2590  Warning: could not send message for past 4 hou
 U  23 Mail Delivery Subs Tue Aug 27 20:19  69/2590  Warning: could not send message for past 4 hou
 U  24 Mail Delivery Subs Tue Aug 27 20:19  69/2590  Warning: could not send message for past 4 hou
 U  25 Mail Delivery Subs Tue Aug 27 20:19  70/2634  Warning: could not send message for past 4 hou
 U  26 Cron Daemon        Tue Aug 27 20:19  22/888   Cron <ravbholua@ravbholua-Aspire-5315> echo bh
 U  27 Cron Daemon        Tue Aug 27 20:19  22/888   Cron <ravbholua@ravbholua-Aspire-5315> echo bh
One thing which I need to look is why sometimes the same cron output it is giving in mails as you can see there are many same mails for time 20:19 although it's expected to mail every minute once.
 
Old 08-28-2013, 04:05 AM   #13
zhjim
Senior Member
 
Registered: Oct 2004
Distribution: Debian Squeeze x86_64
Posts: 1,467
Blog Entries: 11

Rep: Reputation: 184Reputation: 184
For sending mail you do not necessarily need a FQDN. Depends on how you configure your mailer. It's just more robust to have the hostname, domainname setup correctly on the lowest level. Which is /etc/hosts. On top of this goes the mailer which most of the time is configured to use the system FQDN. Also it can just be set hard coded.
And as I like my logs not to print out errors than can be fixed I normaly do this. Just correct your /etc/hosts. Check out the man page or view my previous post.

Regarding the output of mailx I don't know what the time output actually represent. Just see how/if it changes.
 
Old 08-28-2013, 02:35 PM   #14
MikeDeltaBrown
Member
 
Registered: Apr 2013
Location: Arlington, WA
Distribution: Slackware
Posts: 55

Rep: Reputation: 6
You need to set your IP address to something outside the "Loopback" address space and you need to remove the ".com" TLD.

Figure out what IP address your router has (probably something like 192.168.1.1). Then in your /etc/hosts file, change
127.0.1.1 ravbholua-Aspire-5315.localdomain.com
...to something like:
192.168.1.2 ravbholua-Aspire-5315.localdomain ravbholua-Aspire-5315

Configure your interface to have this address:
`ifconfig eth0 192.168.1.2 netmask 255.255.255.0 up`
Of course you'll have to update your network config files so the IP address is configured upon reboot.

Check your routing table with `route -n` to verify your default route points to the router so you can access the internet:
Host# route -n
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 192.168.1.1 0.0.0.0 UG 204 0 0 eth0
If you don't see this, you can add it with:
`route add default gw 192.168.1.1`

Finally, check your router's DHCP service config to make sure 192.168.1.2 is outside the range of IP's it hands out.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
which linux Operating systems applied to Embedded systems? ubun2os Linux - Embedded & Single-board computer 3 03-14-2013 05:24 PM
Is there any difference between ipc on SMP systems and NUMA systems? rainman1985_2010 Programming 0 06-05-2011 11:07 PM
LXer: Isolating Your Linux Systems - How Sharing Operating Systems Can Put Holes in Your PCI Complia LXer Syndicated Linux News 0 04-09-2011 05:10 AM
Read only file systems, custom live CDs, and embedded systems coffeecoffee Linux - Newbie 2 02-25-2009 12:09 AM
setting the systems hosts ip address for the DTE systems in neural network samalaraj Linux - Newbie 1 09-24-2008 01:40 PM


All times are GMT -5. The time now is 03:32 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration