Linux – Multiple Choice Questions – MCQ – 271 to 300 Questions with Explanation

271. On a Debian system, which file contains the hostname of the local machine?

A. /etc/hosts
B. /etc/HOSTS
C. /etc/hostname

Answer – – D
Description – Debian systems use the /etc/HOSTNAME file to store the hostname of the local machine. The /etc/hostname file is used by Red Hat.

272. Which file contains the name servers to be used by the local machine for hostname resolution?

A. /etc/hosts
B. /etc/resolv.conf
C. /etc/services/
D. /etc/network/interfaces

Answer – – B
Description – The /etc/resolv.conf file contains the domain search listing and the name servers to use for hostname resolution.

273. Which of the following is a correct entry in the /etc/hosts file?

A. deedee
B. nameserver
C. search

Answer – – D
Description – Entries in the /etc/hosts file contain an IP address followed by the corresponding hostname.

274. Chat scripts are used to perform which of the following functions?

A. Specify connection device
B. Configure a PPP connection
C. Establish a PPP connection
D. Specify idle timeout of a PPP connection

Answer – – C
Description – Chat scripts are used to establish a PPP connection; pppd is used to configure the connection.

275. The pppd application must receive its IP address via DHCP.

A. True
B. False

Answer – – B
Description – pppd can utilize either static or dynamic IP addresses.

276. Which of the following is NOT a valid option of the pppd command?

A. reconnect
B. connect
C. disconnect
D. holdoff

Answer – – A
Description – reconnect is not a valid option of pppd.

277. Which of the following utilities is used to stop a network interface?

A. ifconfig
B. netstat
C. down
D. stop

Answer – – A
Description – The ifconfig utility is used to stop a network interface.

278. Which socket type is used in inetd.conf when the service uses TCP?

A. dgram
B. stream
C. raw
D. rdm

Answer – – B
Description – The stream type is always used with TCP, and dgram is used with UDP.

279. The inetd.conf file is read every 30 seconds by inetd to look for configuration changes.

A. True
B. False

Answer – – B
Description – Any time the inetd.conf file is changed, inetd needs to be restarted for the changes to take effect.

280. The account used for anonymous FTP should have which shell?

A. /bin/bash
B. /bin/csh
C. /bin/false
D. /bin/ksh

Answer – – C
Description – Anonymous FTP accounts should not have a valid shell statement in /etc/passwd. This limits login to FTP only.

281. Which entry in ftpaccess limits the number of failed password attempts?

A. loginfails
B. loginlimit
C. badpw
D. pwattempts

Answer – – A
Description – If a user exceeds the limit set by loginfails, they are disconnected.

282. Which tool is used to see who is logged in to your FTP server?

A. ftpstats
B. whoftp
C. ftpd -w
D. ftpwho

Answer – – D
Description – The ftpwho command shows who is connected to the FTP server.

283. What needs to be done to create a new mail alias for a user? (Choose all that apply.)

A. Add the alias to /etc/aliases.
B. Add the alias to /etc/mailboxes.
C. Run the newaliases command.
D. Run the addalias command.

Answer – – A and C
Description – Mail aliases are stored in /etc/aliases. Any time an entry is added the newaliases command needs to be run.

284. The _______ command is used to list messages currently in the mail queue.

Answer – – mailq.
Description – The mailq command shows any messages waiting in the queue as well as any errors that may keep them from being delivered.

285. To make your Web server perform the best, it should be run via inetd.

A. True
B. False

Answer – – B
Description – Only run Apache through inetd for a Web server that expects very few hits. The overhead of starting the Apache daemon every time a client connects severely impacts performance.

286. What needs to be done to run httpd through inetd? (Choose all that apply.)

A. Change the port number specified in httpd.conf.
B. Change the ServerType directive in httpd.conf.
C. Add an entry to inetd.conf for httpd.
D. Run inetd -d /usr/sbin/httpd.

Answer – – B and C
Description – An entry needs to be added to the inetd.conf file so that inetd knows to start the service when a user connects. The ServerType entry needs to be set correctly in httpd.conf so that Apache knows not to keep running when a connection completes.

287. By default Apache uses the /etc/passwd file for user authentication.

A. True
B. False

Answer – – B
Description – Apache uses a file created by htpasswd.

288. Which entry or entries in /etc/exports will share the /home directory only to users on the network, which is made up of the domain

A. /home – 254(rw)
B. /home
C. /home *
D. /home

Answer – – B and C
Description – Restrictions can be set using CIDR notation or using wildcards with domains.

289. After editing the /etc/exports file, the _______ command should be run (no parameters).

Answer – – exportfs.
Description – The exportfs command is used to display and change the currently exported directories.

290. Which smb.conf entry sets the Windows NT domain for Samba?

A. workgroup
B. domain
C. nt_domain

Answer – – A
Description – The workgroup entry sets both the workgroup name and the Windows NT domain name.

291. Which command(s) shows all the files on a Windows share using smbclient?

A. dir
B. list
C. cp
D. ls

Answer – – A and D
Description – Both dir and ls can be used to list files. The other Answers are invalid.

292. BIND v4 uses the _____ configuration file.

A. named.boot
B. named.conf
D. conf.named

Answer – – A
Description – BIND v4 uses named.boot while BIND v8 uses named.conf.

293. Which DNS resource record is used to reverse map IP addresses to names?

A. A

Answer – – D
Description – The PTR record is used for reverse queries.

294. Which DNS resource record shows the hosts that provide services?

C. A

Answer – – A
Description – The SRV record shows which hosts provide certain services. The LOC record shows the physical location of a host.

295. Which field should be put at the front of the hosts entry in the nsswitch.conf file to have the system check /etc/hosts first?

A. files
C. dns
D. yp

Answer – – A
Description – The files entry tells the system to check /etc/hosts first. The dns entry specifies when to check with a DNS server.

296. Which mail server has the highest priority?

A. IN MX 10 mail
B. IN MX 20 mail
C. IN MX 100 mail
D. IN MX 0 mail

Answer – – D
Description – The lower the number set in the MX record, the higher the priority for the mail server.

297. Which file is displayed to users before they log in to a system via Telnet?

A. /etc/issue
B. /etc/
C. /etc/
D. /etc/

Answer – – D
Description – The /etc/ file is shown to local users before they log in.

298. Which would allow users from to access your FTP server?

A. hosts.allow: in.ftpd : ANY
B. hosts.deny: ftpd : ALL EXCEPT
C. hosts.allow: in.ftpd :
D. hosts.deny: in.ftpd : ALL

Answer – – C
Description – Option A is incorrect because to allow all hosts you must use the ALL wildcard, not ANY. Choice B specifies the wrong daemon name. Choice D denies all hosts from connecting to the FTP server.

299. Which service cannot be used with TCP wrappers?

B. Telnet
C. tftp

Answer – – C
Description – tftp uses UDP, and TCP wrappers can be used only with TCP applications.

300. Which tool is used to check the logic of your TCP wrapper rules?

A. tcpdmatch
B. tcpwmatch
C. tcpdtest
D. tcpwquery

Answer – – A
Description – The other options are invalid.

For Linux MCQ 301 – 330 | Main Linux MCQ Page

Have something to say about this article? Comment below or share it with us on Facebook or Twitter.

Step by step hacking tutorials about wireless cracking, kali linux, metasploit, ethical hacking, seo tips and tricks, malware analysis and scanning.



Subscribe to Our Newsletter and Get Instant Delivered to Your Email Inbox.

We respect your privacy and take protecting it seriously.

Leave a Reply

Your email address will not be published. Required fields are marked *

seven + 11 =