osx change printer ip address without adding new printer

35,026

Solution 1

You can do this in the CUPS web interface with the following steps:

  1. Open Terminal.app and run cupsctl WebInterface=yes. This enables the CUPS web interface
  2. Open http://127.0.0.1:631/printers in your web browser
  3. Click on the printer you want to change. From the "Administration" drop down, select "Modify Printer".
  4. Log in with your local admin account
  5. Select the new printer IP either from "Discovered Network Printers" or add it manually with "Other Network Printers". Make sure that you keep the same connection protocol as it says in "Current Connection" (for me, this was LPD).

Once you're done with this, Mac OS X will directly print to the new IP address. There is no need to reboot or so. If you want to disable the CUPS web interface again, run cupsctl WebInterface=no.

Solution 2

The configuration information is stored in a system file in /etc/cups/printers.conf. You could edit the file and just change the IP address, but you can easily run into permission problems and end up screaming with frustration.

Here are several options that should work; most require using the terminal command line.

  • Pick your text editor of choice, launch it with administrator privileges, and edit the file directly.
    Example: using terminal, type: sudo vi /etc/cups/printers.conf
    (sudo will launch vi with adminstrator privileges; which will require that you enter your password.)

  • Use sed to modify the file from the command line; here are some examples:

    • sed command line to change IP from 10.1.1.21 to 192.168.1.47, creating a new file:
      sudo sed -i.bak s/10\.1\.1\.21/192\.168\.1\.47/g printers.conf
      To verify the changes, type:
      sudo diff printers.conf printers.conf.bak
    • sed command to change all IPs from 10.1.1.x to 192.168.1.x (leaving final segments unchanged); this will backup the file to printers.conf.bak:
      sudo sed -i.bak s/10\.1\.1\./192\.168\.1\./g printers.conf

Hope that helps.

Share:
35,026

Related videos on Youtube

Craig
Author by

Craig

Updated on September 18, 2022

Comments

  • Craig
    Craig almost 2 years

    Is there a way to change a printer's IP address in OSX (Lion) without having to add a new printer? I did find Printer IP Remedy, but was curious if there was an 'official' method.

    • Admin
      Admin almost 12 years
      Tried Printer IP Remedy on 10.7.4 and it all it seem to do was to remove my print queue
  • Maxx Daymon
    Maxx Daymon over 10 years
    Going through the CUPS web interface is considerably safer and more future-proof than editing backend files directly.
  • Max Masnick
    Max Masnick about 10 years
    See the comment below. Way safer to use the web interface.
  • Stan Kurdziel
    Stan Kurdziel almost 9 years
    The file had a comment about not editing while cupsd was running. So I shut it down while editing and restarted after, but that still didn't work. Removing and re-adding was way faster. I might try the Cups web interface next time.
  • Wildcard
    Wildcard over 8 years
    Except when what you get is "Internal Server Error". What do you do then?
  • Evelina
    Evelina about 8 years
    This still works on El Capitan to remove a printer - seems easier to add a new printer via the GUI with static IP address then remove the old non-working one.
  • LapplandsCohan
    LapplandsCohan over 5 years
    Still works on Mojave
  • T. Christiansen
    T. Christiansen almost 4 years
    Note to my future me: Welcome Back!
  • olore
    olore over 3 years
    7 years later and this still works on Catalina!